{"id":6429,"library":"pymobiledevice3","title":"PyMobileDevice3","description":"PyMobileDevice3 is a pure Python 3 implementation for interacting with iOS devices (iPhone, iPad, etc.). It provides both a command-line interface (CLI) and a Python API, enabling functionalities like device discovery, TCP port forwarding, syslog streaming, application management, AFC file access, and more. The library is actively maintained with frequent releases, currently at version 9.9.1.","status":"active","version":"9.9.1","language":"en","source_language":"en","source_url":"https://github.com/doronz88/pymobiledevice3","tags":["ios","iphone","ipad","apple","mobile","device","automation","usb","lockdown"],"install":[{"cmd":"pip install -U pymobiledevice3","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required on Linux for device communication. Typically installed via `sudo apt install usbmuxd` on Debian/Ubuntu.","package":"usbmuxd","optional":false},{"reason":"Required on Windows for device communication.","package":"iTunes","optional":false},{"reason":"Explicitly required for interacting with iOS versions older than 13. Install via `brew install openssl` (macOS) or `sudo apt install openssl` (Linux).","package":"OpenSSL","optional":true},{"reason":"Required for Recovery/DFU mode interactions (e.g., restore subcommands). Installation varies by OS.","package":"libusb","optional":true}],"imports":[{"symbol":"create_using_usbmux","correct":"from pymobiledevice3.lockdown import create_using_usbmux"},{"symbol":"SyslogService","correct":"from pymobiledevice3.services.syslog import SyslogService"},{"note":"LockdownClient is the primary entry point for managing lockdown services, not LockdownService.","wrong":"from pymobiledevice3.lockdown import LockdownService","symbol":"LockdownClient","correct":"from pymobiledevice3.lockdown import LockdownClient"}],"quickstart":{"code":"import asyncio\nimport os\nfrom pymobiledevice3.lockdown import create_using_usbmux\nfrom pymobiledevice3.services.syslog import SyslogService\n\nasync def main():\n    # This example connects to a USB-connected and trusted iOS device\n    # and streams its syslog output.\n    try:\n        lockdown = await create_using_usbmux()\n        device_name = lockdown.get_device_name()\n        device_udid = lockdown.udid\n        print(f\"Connected to device: {device_name} (UDID: {device_udid})\")\n\n        syslog_service = SyslogService(service_provider=lockdown)\n        print(\"\\nStreaming syslog (press Ctrl+C to stop)...\\n\")\n\n        async for line in syslog_service.watch():\n            print(line)\n\n    except Exception as e:\n        print(f\"\\nError: {e}\")\n        print(\"Please ensure:\")\n        print(\"1. An iOS device is connected via USB and is trusted by your computer.\")\n        print(\"2. On Linux, 'usbmuxd' is installed and running. On Windows, iTunes is installed.\")\n        print(\"3. For older iOS versions (<13), OpenSSL is installed.\")\n        print(\"4. If accessing developer services on iOS 17+, a tunnel is established (e.g., 'sudo python3 -m pymobiledevice3 remote start-tunnel').\")\n\nif __name__ == '__main__':\n    asyncio.run(main())","lang":"python","description":"This quickstart demonstrates how to connect to a USB-attached iOS device and stream its syslog using the PyMobileDevice3 Python API. It includes necessary imports and basic error handling for common setup issues. Ensure your device is connected and trusted before running."},"warnings":[{"fix":"Before using developer services, establish a tunnel. You can use `sudo python3 -m pymobiledevice3 remote tunneld` to automatically detect devices and establish connections, or manually create one with `sudo python3 -m pymobiledevice3 remote start-tunnel`.","message":"For iOS 17.0 and later, developer services require tunnel-based transport (e.g., `tunneld` or `start-tunnel`) due to Apple's new CoreDevice framework. Direct connections to developer services will fail without a tunnel.","severity":"breaking","affected_versions":">=17.0 (iOS)"},{"fix":"Update scripts to use `pymobiledevice3 remote start-tunnel` instead of `pymobiledevice3 remote start-quic-tunnel`.","message":"The CLI command `start-quic-tunnel` was renamed to `start-tunnel` (e.g. for creating developer tunnels). Scripts using the old command will break.","severity":"breaking","affected_versions":">=2.31.0 (pymobiledevice3)"},{"fix":"Install the appropriate system-level dependencies for your operating system as specified in the documentation (e.g., `usbmuxd` on Linux, iTunes on Windows).","message":"Platform-specific external dependencies are required for PyMobileDevice3 to function. Windows users need iTunes, Linux users need `usbmuxd`, and for Recovery/DFU mode or older iOS versions, `libusb` and `OpenSSL` might be necessary.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of this performance characteristic when designing deployments. Consider alternative deployment strategies or accept the startup overhead. This is generally due to the 'bundled python' overhead.","message":"When bundling PyMobileDevice3 into an executable (e.g., using PyInstaller), there can be a significant performance overhead and startup delay (up to 10 seconds or more) compared to running directly from an installed Python environment.","severity":"gotcha","affected_versions":"All versions when bundled"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}