Skip to content

Control a real USB-connected iPhone from Linux (no Mac, no paid developer account) and expose it to AI agents as MCP tools

7.9 KB
Raw Blame

Getting Started

Install the program, plug in the phone, run iphone-control and follow the guide. It takes about 15 minutes. The steps are the same on Linux and a Mac; Mac details are in macOS.

You need

  • A host: a Mac with Apple silicon, or Linux (x86_64, aarch64)
  • An iPhone or iPad and a cable that carries data. iOS 27 or later is recommended: native control, nothing installed on the phone, no Apple ID. iOS 17–26 work too, through WebDriverAgent
  • On iOS 26 and earlier, a free Apple ID (a dedicated one is recommended) to sign WebDriverAgent
  • Internet access to Apple and GitHub from the host (the guide asks for a proxy if you need one)

::: warning One phone, one owner Don't run two copies of iphone-control, or other usbmuxd-based tools (go-ios, pymobiledevice3, …), against the same phone. :::

1. Install {#install}

Pick one of the three. Install as your regular user; don't run iphone-control as root or with sudo.

One command (macOS or Linux, with Python 3 and OpenSSL 3 on PATH)

curl -fsSLo iphone-control-install.sh https://github.com/Derrors/iphone-control/releases/latest/download/install.sh && sh iphone-control-install.sh

It installs the program into ~/.local/bin and the daemon as a per-user service (launchd on macOS, a systemd user service on Linux) that starts when you log in. Run iphone-control update to check for and install an upgrade, or iphone-control update check to check versions only. Pass --version vX.Y.Z for a specific signed release, --prefix DIR to install into DIR/bin, or --no-service to install only the program. For upstream v0.2.0, use the legacy script instructions.

Homebrew (macOS, Linux):

brew install derrors/tap/iphone-control
brew services start iphone-control

Debian / Ubuntu package: download iphone-control_<version>_amd64.deb (_arm64.deb on ARM) from the GitHub Release, then:

sudo apt install ./iphone-control_<version>_amd64.deb
systemctl --user enable --now iphone-control     # as your regular user; each user turns it on for themselves

You can skip the second line: the guide below starts it for you.

::: tip Linux needs the system usbmuxd Talking to the phone over USB goes through the system's usbmuxd: sudo apt install usbmuxd (or your distribution's package manager). The .deb pulls it in. :::

::: tip Optional: ffmpeg On Linux with ffmpeg installed, the control page's picture is H.264, about 1/15 of the traffic, which is much smoother through a tunnel or over the internet: sudo apt install ffmpeg. On macOS it is H.264 without installing anything. See the control page's picture. :::

The one-line installer and Homebrew work on Apple Silicon and Intel Macs (Intel packages from 0.2.14). Development runs from source; see Build from Source.

Upstream v0.2.0 script installation and migration {#legacy-script}

The v0.2.0 release uses archive checksums and has no signed installer asset. To install this version, use its tagged script and specify the same release for the binary.

curl -fsSLo iphone-control-v0.2.0-install.sh https://raw.githubusercontent.com/Derrors/iphone-control/v0.2.0/install.sh && sh iphone-control-v0.2.0-install.sh --version v0.2.0

To migrate an existing v0.2.0 script installation, first confirm the signed release includes install.sh, your platform's manifest and its signature. Close Viewer and MCP clients, stop the daemon, then remove the old binary and service with the v0.2.0 script. This keeps your settings and device data.

curl -fsSLo iphone-control-v0.2.0-install.sh https://raw.githubusercontent.com/Derrors/iphone-control/v0.2.0/install.sh && sh iphone-control-v0.2.0-install.sh --uninstall

Then run the signed installer. If your old installation used --prefix DIR, pass the same option to both the uninstall and the new installation.

2. Plug in the phone and run iphone-control {#first-run}

Plug in the phone with a cable, unlock it, then run in a terminal:

iphone-control

The first time, it walks you through setup step by step. Steps that are already done are skipped; if you stop halfway, running iphone-control again picks up where you left. It needs an interactive terminal.

A phone on iOS 27 or later is controlled natively, so the guide skips the Apple ID and WDA steps: the rows marked iOS 26 and earlier below don't apply.

Step What you do
Language Pick 中文 or English
Proxy Enter a proxy URL if you need one, e.g. http://127.0.0.1:7890
Background service If no service is set up yet, press Enter to set it up and start it
Waiting for the phone Unlock it
Pairing On the phone, tap Trust when asked "Trust This Computer?", enter the passcode
Developer Mode On the phone: Settings → Privacy & Security → Developer Mode → On, restart, then tap Turn On after unlocking
Apple ID (iOS 26 and earlier) In the terminal, enter the Apple ID, password and two-factor code
Sign and install WDA (iOS 26 and earlier) Keep the phone unlocked
Waiting for the phone to get ready (iOS 27 and later) Keep it unlocked; usually a few seconds to half a minute
Waiting for WDA (iOS 26 and earlier) On the phone: Settings → General → VPN & Device Management → trust your Apple ID (needs internet); if asked to enter the iPhone passcode for "XCTest", enter it
Auto-unlock (optional) Enter the passcode if you want it; see Auto-unlock
Notifications (optional) Pick Bark or Telegram and enter the key or token; a test message is sent. See Notifications
MCP registration If Claude Code or Codex is found, press Enter to register with it

You're finished when it says All set. Settings are saved in ~/.config/iphone-control/env; see Configuration.

::: tip Your password stays in the terminal The Apple ID password and code are only typed here and never written to disk; only the resulting session is stored. :::

From then on, iphone-control just shows the status, and starts the daemon first if it isn't running. To change a setting, run iphone-control setup --reconfigure and pick the part to set up again; see CLI.

3. Try it

Open a new Claude Code or Codex session and say:

Open Settings on the iPhone and tell me which iOS version it runs.

The agent will use iphone_launch_app, iphone_tap_element, iphone_screenshot and friends. Other clients: Connect an AI Client.

You can also watch and control the phone in a browser, or hand tasks to a local Claude Code or Codex there:

iphone-control viewer          # the control page, on http://127.0.0.1:8200
iphone-control viewer token    # in another terminal: open the link it prints to log in

The page needs a login, on this machine too; a browser stays logged in for 30 days. The local network, read-only tokens and use from other machines: Viewer and Remote Use.

Checking on it

iphone-control status   # state, native or WDA, recent log
iphone-control doctor   # layer-by-layer checks with a fix for each failure

Something wrong? See the FAQ.

Uninstall

Installed with Uninstall
Signed installer Run sh iphone-control-install.sh --uninstall using the script downloaded above and your original prefix
v0.2.0 script Use the v0.2.0 uninstall command
Homebrew brew services stop iphone-control, then brew uninstall iphone-control
.deb systemctl --user disable --now iphone-control, then sudo apt remove iphone-control

The data directory ~/.local/share/iphone-control (Apple ID session, signing, auto-unlock passcodes) stays; delete it if you no longer need it, and if WDA was used, remove WebDriverAgent on the phone.