Skip to content

pymobiledevice3 afc

Browse, push, and pull files via the AFC service (/var/mobile/Media).

shell

Open an interactive AFC shell rooted at /var/mobile/Media.

pymobiledevice3 afc shell [OPTIONS]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.
--tool <list[str]> also offer this host tool as a command inside the shell, e.g. --tool jq (repeatable)

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

webdav

Serve /var/mobile/Media over WebDAV for local mounting (e.g. in Finder).

pymobiledevice3 afc webdav [OPTIONS] [path]

Arguments:

Argument Description
path <str> AFC path to serve as the volume root (default: /) [default: /]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.
--mount mount the served path locally and reveal it in your file manager
--host <str> local interface to bind [default: 127.0.0.1]
--bind-port <int> local TCP port (0 picks a free port) [default: 0]
--readonly expose the path read-only

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

pull

Download a file or directory (recursively) from /var/mobile/Media.

pymobiledevice3 afc pull [OPTIONS] {remote_file} {local_file}

Arguments:

Argument Description
remote_file <str> File or directory on the device, relative to /var/mobile/Media. [required]
local_file <path> Local destination path. [required]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.
-i, --ignore-errors Continue downloading even if some files error (best-effort pull).

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

push

Upload a local file or directory (recursively) into /var/mobile/Media.

An existing file at the destination is overwritten.

pymobiledevice3 afc push [OPTIONS] {local_file} {remote_file}

Arguments:

Argument Description
local_file <path> Local file or directory to upload. [required]
remote_file <str> Destination on the device, relative to /var/mobile/Media (may be a directory). [required]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.

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

ls

List files under /var/mobile/Media (optionally recursively).

pymobiledevice3 afc ls [OPTIONS] {remote_file}

Arguments:

Argument Description
remote_file <str> Directory on the device, relative to /var/mobile/Media. [required]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.
-r, --recursive Recurse into subdirectories when listing.

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

rm

Delete a file or a whole directory tree under /var/mobile/Media (no confirmation).

pymobiledevice3 afc rm [OPTIONS] {remote_file}

Arguments:

Argument Description
remote_file <str> File or directory on the device, relative to /var/mobile/Media. [required]

Options:

Option Description
--remotepairing Build the no-root userspace tunnel over RemotePairing instead of USB, for a device paired over the network with remote pair (e.g. an Apple TV, on Wi-Fi or Ethernet). Found over bonjour; --udid names the identifier the RemotePairing record is stored under (remote_.plist), required when there are several. Implies --userspace; mutually exclusive with --rsd/--tunnel/--native. [env var: PYMOBILEDEVICE3_REMOTEPAIRING]
--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]
--mobdev2-host HOSTNAME Connect over mobdev2 to the device at this hostname or IP address, without browsing for it.

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