Skip to content

pymobiledevice3 backup2

Create, inspect, and restore MobileBackup2 backups.

backup

Back up the device to this computer (like a Finder/iTunes backup).

All backup data will be written to BACKUP_DIRECTORY, under a directory named with the device's udid. Keep the device connected until it finishes.

pymobiledevice3 backup2 backup [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--full / --no-full Force a full backup and discard previous local backup state. By default, backup is incremental when valid local metadata exists, and automatically becomes full for an empty or incomplete backup directory. [default: no-full]
--only <bookmarks\|call_history\|contacts\|messages\|sms\|whatsapp> Preserve only selected backup payload presets. Repeat to keep multiple presets.
--only-regex <str> Preserve only backup payloads whose device path or manifest path matches this regex. Repeat to keep multiple regexes.
--patch-manifest / --no-patch-manifest Remove entries for discarded payloads from Manifest.db. Encrypted backups require --password when this option is used. [default: no-patch-manifest]
-p, --password <str> Backup password.
--unback Also unpack the completed backup locally using pyiosbackup. Existing unpacked contents are replaced. Filtered backups require --patch-manifest.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

restore

Restore a backup onto the device, replacing its data with the backup's.

The backup will be restored from a directory with the device udid (or --source) under BACKUP_DIRECTORY. The device reboots when done unless --no-reboot is given.

pymobiledevice3 backup2 restore [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--system / --no-system Restore system files. [default: no-system]
--reboot / --no-reboot Reboot the device when done. [default: reboot]
--copy / --no-copy Create a copy of backup folder before restoring. [default: no-copy]
--settings / --no-settings Restore device settings. [default: settings]
--remove / --no-remove Delete items on the device that aren't part of the backup. [default: no-remove]
--skip-apps / --no-skip-apps Do not trigger re-installation of apps after restore. [default: no-skip-apps]
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

info

Print information about a backup.

pymobiledevice3 backup2 info [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

list

List all files in the backup, in CSV format.

pymobiledevice3 backup2 list [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

unback

Unpack the backup into a regular, browsable directory tree of its files.

pymobiledevice3 backup2 unback [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

extract

Extract a file from the backup.

The file that belongs to the domain DOMAIN_NAME and located on the device in the path RELATIVE_PATH, will be extracted to the BACKUP_DIRECTORY.

pymobiledevice3 backup2 extract [OPTIONS] {domain_name} {relative_path} {backup_directory}

Arguments:

Argument Description
domain_name Backup domain of the file (e.g. HomeDomain). [required]
relative_path Path of the file within the domain. [required]
backup_directory Local directory holding the backups (each device's backup is in a subdirectory named by its UDID). [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

encryption

Set backup encryption on / off, or report the current encryption state when run without arguments.

When on, PASSWORD will be the new backup password. When off, PASSWORD is the current backup password.

pymobiledevice3 backup2 encryption [OPTIONS] [mode]:<on|off> [password]

Arguments:

Argument Description
mode:<on\|off> Turn encryption on or off; omit to print the current state.
password New password when turning on; current password when turning off.

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-b, --backup-directory <directory> Local backup directory used for the exchange with the device. [default: .]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

cloud

Turn iCloud Backup on / off.

pymobiledevice3 backup2 cloud [OPTIONS] {mode}:<on|off>

Arguments:

Argument Description
mode:<on\|off> Turn iCloud Backup on or off. [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

change-password

Change the backup password.

pymobiledevice3 backup2 change-password [OPTIONS] {old_password} {new_password}

Arguments:

Argument Description
old_password Current backup password. [required]
new_password New backup password. [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-b, --backup-directory <directory> Local backup directory used for the exchange with the device. [default: .]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

erase-device

Erase all content and settings on the device (factory reset). DESTRUCTIVE.

There is no confirmation.

pymobiledevice3 backup2 erase-device [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory Local backup directory used for the exchange with the device. [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode. Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel, but the device keeps a single RSD connection on it: remoted and this process evict each other's, which can reset connections and leave Xcode/devicectl without the device until remoted reconnects. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.