Libimobiledevice: Difference between revisions

From NixOS Wiki
imported>Mic92
ios: fix link
imported>Onny
Add section on how to perform factory reset
Line 1: Line 1:
== Usage ==
In order to be able to automatically mount your iOS device (such as an iPhone) when connecting it, you need to install <code>libimobiledevice</code> and to activate the <code>usbmuxd</code> service.
In order to be able to automatically mount your iOS device (such as an iPhone) when connecting it, you need to install <code>libimobiledevice</code> and to activate the <code>usbmuxd</code> service.


Line 29: Line 32:
</syntaxhighlight>
</syntaxhighlight>
(it may take a bit of time)
(it may take a bit of time)
== Maintainence ==
=== Factory reset ===
The following section describes how to perform a hard/factory reset and reinstalling the latest firmware. First install and enable the required daemon and package.
<syntaxhighlight lang="nix">
services.usbmuxd.enable = true;
environment.systemPackages = with pkgs; [
  idevicerestore
];
</syntaxhighlight>
<syntaxhighlight lang="console">
# sudo idevicerestore --erase --latest
Found device in DFU mode
Identified device as n69ap, iPhone8,4
The following firmwares are currently being signed for iPhone8,4:
  [1] 15.7 (build 19H12)
Select the firmware you want to restore: 1
Selected firmware 15.7 (build 19H12)
Downloading firmware (https://updates.cdn-apple.com/...)
downloading: 99% ...
Verifying 'iPhone_****.ipsw'...
Checksum matches.
Extracting BuildManifest from IPSW
Product Version: 15.7
Product Build: 19H12 Major: 19
Device supports Image4: true
Variant: Customer Erase Install (IPSW)
This restore will erase your device data.
################################ [ WARNING ] #################################
# You are about to perform an *ERASE* restore. ALL DATA on the target device                        #
# will be IRREVERSIBLY DESTROYED. If you want to update your device without                      #
# erasing the user data, hit CTRL+C now and restart without -e or --erase                                  #
# command line switch.                                                                                                                  #
# If you want to continue with the ERASE, please type YES and press ENTER.                          #
#############################################################################
> YES
Checking IPSW for required components...
All required components found in IPSW
Extracting filesystem from IPSW: 078-69441-013.dmg
[========================                          ]  46.9%
</syntaxhighlight>

Revision as of 13:24, 12 October 2022

Usage

In order to be able to automatically mount your iOS device (such as an iPhone) when connecting it, you need to install libimobiledevice and to activate the usbmuxd service.

Add the following to your configuration.nix:

services.usbmuxd.enable = true;
environment.systemPackages = with pkgs; [
  libimobiledevice
  ifuse # optional, to mount using 'ifuse'
];

You can then mount your device using ifuse:

$ mkdir /tmp/iphone
$ ifuse /tmp/iphone

If you get an error about ERROR: No device found!, check the status of usbmuxd:

$ sudo systemctl status usbmuxd.service

If you see an error

ERROR: Could not connect to lockdownd on device [...], lockdown error -8

you may need to restart the usbmuxd service as reported here:

$ sudo systemctl restart usbmuxd.service

(it may take a bit of time)

Maintainence

Factory reset

The following section describes how to perform a hard/factory reset and reinstalling the latest firmware. First install and enable the required daemon and package.

services.usbmuxd.enable = true;
environment.systemPackages = with pkgs; [
  idevicerestore
];
# sudo idevicerestore --erase --latest
Found device in DFU mode
Identified device as n69ap, iPhone8,4
The following firmwares are currently being signed for iPhone8,4:
  [1] 15.7 (build 19H12)
Select the firmware you want to restore: 1
Selected firmware 15.7 (build 19H12)
Downloading firmware (https://updates.cdn-apple.com/...)
downloading: 99% ...
Verifying 'iPhone_****.ipsw'...
Checksum matches.
Extracting BuildManifest from IPSW
Product Version: 15.7
Product Build: 19H12 Major: 19
Device supports Image4: true
Variant: Customer Erase Install (IPSW)
This restore will erase your device data.
################################ [ WARNING ] #################################
# You are about to perform an *ERASE* restore. ALL DATA on the target device                         #
# will be IRREVERSIBLY DESTROYED. If you want to update your device without                      #
# erasing the user data, hit CTRL+C now and restart without -e or --erase                                   #
# command line switch.                                                                                                                  #
# If you want to continue with the ERASE, please type YES and press ENTER.                           #
#############################################################################
> YES
Checking IPSW for required components...
All required components found in IPSW
Extracting filesystem from IPSW: 078-69441-013.dmg
[========================                          ]  46.9%