Skip to content

About

Let AI agents control real iPhones & iPads over USB or Wi-Fi (macOS & Linux). Single Rust binary, MCP server + live viewer — no Xcode, no jailbreak, no Apple ID on iOS 27+.

Topics

Resources

Contributing

Security policy

Stars

224 stars

Watchers

1 watching

Forks

Latest commit

 

History

298 Commits

Folders and files

Repository files navigation

iphone-control: Let AI agents operate real iPhones and iPads over USB or Wi-Fi

Let AI agents operate real iPhones and iPads over USB or Wi-Fi from Linux or macOS, reliably and fast — one Rust binary, no Xcode, no paid developer account, no jailbreak, and from iOS 27 no Apple ID either.

Release iOS: 27+ recommended, 17+ supported Platform: Linux | macOS Connection: USB | Wi-Fi MCP Rust License M8ven verified Derrors/iphone-control MCP server

🚀 Quick Start  ·  📖 Docs  ·  📦 Releases  ·  🐛 Issues  ·  💬 Discussions  ·  🌐 简体中文

demo-combined-wifi.mp4

Claude Code driving a real iPhone 15 Pro Max (iOS 27.2.1, native control) over Wi-Fi from Linux: searching Apple Maps and steering mid-run to Sensō-ji Temple, then creating a Clock alarm, changing it from 07:30 to 08:15 mid-task (say), and pausing for human approval before deleting it. Idle waits sped up; ~60 fps hardware HEVC stream.

Overview

iphone-control gives AI agents direct, reliable control over real iPhones and iPads in one Rust binary on Linux or macOS — over USB or Wi-Fi, with no Xcode, no paid Apple Developer account and no jailbreak. Built on idevice, Impactor and WebDriverAgent, it succeeds iphone-control-toolkit and keeps its MCP tools compatible.

It has three layers, and device control is the core:

Layer What it does Needs the control page?
Device control (core) A long-running daemon owns the phone over USB or Wi-Fi and serves the MCP tools; recovers from unplugging and reboots; scales to multiple devices in parallel via named instances; pauses, steers, takes over and confirms AI tasks No
Access AI clients on this machine connect over stdio; other machines over HTTP MCP (/mcp) or mcp --url Locally no; remotely the viewer service must run
Control page (optional) Watch the live screen in a browser (~60 fps on iOS 27+), act on it, hand out and steer AI tasks It is the control page

Device control has two routes, picked by iOS version:

  • iOS 27 and later: native control (default). The screen is read through the system's accessibility service, taps, swipes and buttons go through HID, and apps launch through CoreDevice. Nothing is installed on the phone: no Apple ID, no signing, ready in seconds, with ~60 fps hardware video.
  • iOS 17–26: WebDriverAgent. Signed with a free Apple ID, installed on the phone and re-signed automatically before the 7-day profile expires. Works over USB and Wi-Fi (listening only inside the authenticated tunnel). This route stays maintained.

Tip

Use a device on iOS 27 or later if you can, or update the phone to iOS 27: no Apple ID sign-in, no signing, no "Enable UI Automation" passcode after a reboot, and none of the expiring profiles, revoked certificates or stuck WebDriverAgent that come with it.

Architecture: AI clients use iphone-control mcp over stdio, and the optional control page serves browsers and remote agents over HTTPS; both talk to the daemon over a Unix socket. The daemon is the core: it drives the iPhone or iPad over USB or Wi-Fi, natively on iOS 27 and later and through WebDriverAgent on iOS 17–26, and keeps running with the control page closed

Features

Device control (core): native on iOS 27+, USB & Wi-Fi control, 18 MCP tools & batch, multi-device & parallel, human in control, runs unattended. Access: on this machine, remotely. Control page (optional): 60 fps control page

Device control (core)

  • One binary, zero Mac/Xcode lock-in: single Rust binary for Linux (x86_64 / arm64) and macOS (Apple Silicon / Intel), with guided setup, signed self-updates (iphone-control update), Homebrew tap and Debian .deb
  • USB & Wi-Fi wireless control: enable Wi-Fi once over USB (iphone-control wifi on), then unplug and stay connected to the same MCP session within seconds — works on both iOS 27+ (native) and iOS 17–26 (WDA inside the authenticated tunnel); on Linux the daemon discovers and keeps Wi-Fi phones alive without usbmuxd
  • See and touch the screen: screenshots with structured coordinate geometry and region zoom, tap, swipe, long-press, text input (including Chinese, with readback verification), hardware buttons
  • Work with UI elements: read the element tree, tap by text/kind/id (avoiding floating bars and the keyboard, verifying bounds and foreground app before tapping), launch and close apps, open URLs, wait for text to appear or disappear
  • Fewer round trips & tokens: any action can return the settled screen (then: "elements" | "screenshot"), report whether it changed, and flag loading pages or blocking alerts; iphone_batch runs up to 20 steps in one call and iphone_scroll_collect gathers long lists in one pass
  • Several devices — switch or run in parallel: switch among connected USB and Wi-Fi devices with select / iphone_select_device, or create isolated named instances (instance add) so multiple AI agents each drive their own iPhone or iPad at the same time
  • A person stays in charge: pause, take over, stop, or steer a running AI task without stopping it (task say or from the control page — your note arrives with the next tool result); paying, deleting or sending waits for your OK, and an agent can't approve its own task
  • Runs unattended: recovers from replugging, USB/Wi-Fi handoffs, phone reboots and lost connections with the control page closed; stuck WebDriverAgent instances are restarted and re-signed before expiry
  • Optional auto-unlock & alerts: every passcode digit is verified and a wrong passcode disables auto-unlock after one attempt; Telegram or Bark alerts for offline devices, post-reboot passcodes, re-sign failures and abnormal daemon restarts
  • Opt-in developer tools & diagnostics: IPHONE_CONTROL_DEV_TOOLS=1 adds 6 tools for app logs, crash reports, installing/removing apps and Web Inspector JS; doctor checks every layer from USB/Wi-Fi up and tells you how to fix each failure

Access

  • On this machine: Claude Code, Codex or any MCP client over stdio; ships with an official layered Agent Skill (installable as a Claude Code plugin); task run runs any agent platform in a task whose every step you can follow
  • Remotely: the viewer service serves HTTP MCP (/mcp) on its port, over HTTPS with a login token (read-only ones too) when opened to the network; mcp --url and task --url use a phone on another machine

Control page (optional)

  • Live screen: on iOS 27 and later the phone's own hardware video (about 60 fps, zero host encoding), otherwise H.264; includes a low-bandwidth mode
  • Act on it: the mouse taps and drags like a finger; system alerts missing from the video are drawn on it and can be tapped
  • Hand out and steer tasks: give a task to a local Claude Code or Codex, watch it work, send live instructions mid-run (say), or take over at any time

Why iphone-control?

Capability iphone-control Appium / Xcode WDA macOS iPhone Mirroring tools Xcode Simulator / devicectl
Runs on Linux Yes (x86_64 & arm64) Needs macOS to build/sign WDA No (macOS Sequoia only) No (macOS + Xcode)
No Xcode / paid Apple Dev account Yes Needs Xcode for WDA signing Yes No
Zero app / Apple ID on phone Yes on iOS 27+ (auto-resigning WDA on iOS 17–26) No (installs WDA) Yes Simulator / Xcode runner
Real device over USB & Wi-Fi Yes (Linux self-discovers Wi-Fi) Mostly USB / manual setup Wi-Fi via Continuity USB / local network
Parallel multi-device Yes (instance add per device) Heavy per-device WDA setup Single active mirroring window Multiple simulators / Xcode
Live video & mid-run AI steering 60 fps viewer + task say + approval gates No built-in viewer / steering Occupies desktop focus No
Unattended self-recovery Daemon recovers from replugs, reboots & stuck WDA Manual restart Stops when host sleeps/switches Manual

See Use cases & comparison for real setups (spare iPhone on a Linux box, multi-device farms, QA & Web Inspector).

Quick Start

You need an iPhone or iPad (iOS 27+ recommended, iOS 17+ supported) connected by a data cable, and a Mac (macOS 11+, Apple Silicon or Intel) or a Linux machine. On iOS 26 and earlier you also need a free Apple ID (use a dedicated one) to sign WebDriverAgent.

1. Install — one command on macOS or Linux, or use a package manager:

# macOS or Linux (signed installer — verifies Ed25519 manifest & SHA-256)
curl -fsSLo iphone-control-install.sh https://github.com/Derrors/iphone-control/releases/latest/download/install.sh && sh iphone-control-install.sh

# Or Homebrew (macOS / Linux)
brew install derrors/tap/iphone-control && brew services start iphone-control

# Or Debian 12+ / Ubuntu 22.04+ (.deb from Releases, pulls in usbmuxd)
sudo apt install ./iphone-control_<version>_amd64.deb && systemctl --user enable --now iphone-control
Installer details, Linux/Intel Mac notes & v0.2.0 migration
  • What the installer does: downloads the release for your machine, verifies the Ed25519 release manifest and archive SHA-256 (Python 3 and OpenSSL 3 required), installs iphone-control into ~/.local/bin and registers a per-user background service (launchd on macOS, systemd on Linux). Run it as your regular user; for a fork, use the installer asset from its own signed release. Upgrade with iphone-control update; uninstall with sh iphone-control-install.sh --uninstall (your data stays).
  • Linux: requires the system usbmuxd (sudo apt install usbmuxd; the .deb installs it automatically).
  • Intel Mac: packages come with 0.2.14 and later; cross-compiled on Apple Silicon and tested under Rosetta, not yet on a real Intel Mac.
  • v0.2.0 / legacy script: upstream v0.2.0 predates the signed installer — see v0.2.0 instructions.

2. Connect your phone and run the guided setup:

iphone-control

The first time, it walks you through setup in the terminal, one step at a time: language, proxy, the background service, pairing, Developer Mode (and on iOS 26 and earlier, Apple ID and signing and installing WebDriverAgent), the optional auto-unlock and notifications, and registering with Claude Code and Codex. Do what it asks on the phone. Steps already done are skipped; afterwards, iphone-control just shows the status.

3. Try asking Claude Code or Codex:

Open a new session and try prompts like:

  • “Open Settings → Battery, tell me the top three battery-draining apps in the last 24 hours, and return to the Home Screen.”
  • “Open Clock, switch to the stopwatch and start it.”
  • “Find the top 5 unread newsletters in Mail and summarize them — don't delete or reply to anything.”
  • “Open Safari, go to my local dev page, inspect the console/DOM via Web Inspector, and capture a screenshot.” (with IPHONE_CONTROL_DEV_TOOLS=1)

That is device control, complete; the control page is optional.

  • Go wireless (optional): run iphone-control wifi on while the phone is plugged in, then unplug — it stays connected over Wi-Fi within seconds.
  • Claude Code Plugin (optional): install the bundled Agent Skill in Claude Code for guided element selection, batching and troubleshooting:
    /plugin install iphone-control --marketplace Derrors/iphone-control
    
  • Browser control page (optional): run iphone-control viewer (http://127.0.0.1:8200; log in with the link iphone-control viewer token prints) to watch the live screen, act on it and hand out or steer tasks mid-run (task say) for a local Claude Code or Codex; it works from the local network and other machines too, see Viewer and Remote Use.

More: step-by-step guide · use cases · several devices at once · build from source · macOS guide · other MCP clients.

MCP Tools

Tool Description
iphone_status Connection, lock state, foreground app, screen size
iphone_screenshot Screenshot scaled to points; pass x/y/width/height to zoom into a region
iphone_list_elements Elements with text and their center coordinates; filter by text or type
iphone_tap / iphone_tap_element Tap by coordinates or by element text, kind, or id
iphone_swipe / iphone_long_press Swipe (returns once the list stops), long-press
iphone_type_text Type into the focused field; reads it back and fixes dropped characters
iphone_press_button home, volume_up, volume_down, lock
iphone_list_apps / iphone_launch_app / iphone_terminate_app Manage apps by name or bundle ID
iphone_open_url Open a URL or URL scheme
iphone_wait_for Wait until some text appears (or, with state: "disappeared", goes) instead of polling with screenshots
iphone_scroll_collect Scroll through a list and collect its rows in one call, or stop where some text shows up
iphone_batch Run up to 20 steps in one call, stopping at the first error
iphone_list_devices Every iPhone/iPad connected over USB or Wi-Fi; marks the one being controlled
iphone_select_device Switch to another device, or back to automatic choice

IPHONE_CONTROL_DEV_TOOLS=1 adds six opt-in developer tools: logs, crash reports, installing and removing apps, and two for Web Inspector (list web pages, run JavaScript in them). They are off by default; read the security notes before turning them on.

Action tools accept then: "elements" | "screenshot" to return the screen after the action. Screenshot pixels are tap coordinates, so the agent can tap what it sees. Games, maps and video players draw their own UI and have no element tree — use screenshots and coordinates there. Full parameters: docs/tools.md.

Tool texts, results, CLI output and logs follow your system locale (zh* for Simplified Chinese, otherwise English), or set IPHONE_CONTROL_LANG=en / zh explicitly (configuration).

Everyday Commands

Command What it does
(none) The first time, the setup guide; after that, the status (and starts the service if it isn't running)
setup [--reconfigure] Run the setup guide again; --reconfigure redoes one part (language, proxy, service, Apple ID, phone, auto-unlock, notifications, MCP registration)
service install|uninstall|start|stop|restart|status The background service (launchd on macOS, systemd user unit on Linux)
daemon The long-running daemon; the service runs it, or start it by hand
mcp [--url <viewer>] The MCP server; your AI client starts it. With --url it bridges to another machine's viewer
status Daemon state, time left on the signing profile, recent log
doctor Layer-by-layer health check with a fix for each failure
login Sign in to the Apple ID again when the session expires (WebDriverAgent devices only)
sign Sign and install WebDriverAgent now (likewise)
resign [--force] Re-sign WebDriverAgent if it expires soon (or now) (likewise)
passcode set|clear Turn auto-unlock on or off for a device (passcodes are kept per device)
unlock-reset Turn auto-unlock back on after it was disabled
devices / select <UDID|name|auto> List USB and authorized Wi-Fi devices / switch which one is controlled
wifi [on|off] [UDID] List Wi-Fi-enabled devices, or grant/revoke wireless control (first grant over USB)
instance add|list|remove Run separate isolated instances so multiple agents can control multiple devices at once
notify-test [event] Send test notifications
mcp-config Print the command that registers the MCP server
wda-bridge [--port] Expose WebDriverAgent on 127.0.0.1 for other tools; stop it when done (WebDriverAgent devices only)
viewer [--port] [--lan] Control page on 127.0.0.1:8200, behind a login (viewer token shows the token and a link; read-only tokens too): live screen you can tap, swipe and type on, device panel, and AI tasks run by a local Claude Code or Codex. --lan opens it to the local network (HTTPS), and MCP over HTTP is on the same port (/mcp)
task run [--url <viewer>] -- <command> AI tasks for other agent platforms; with --url the phone is on another machine. task list, say, pause, approve… follow, steer and control tasks
viewer token [add <name> [--read-only]|list|show <name>|remove <name>] The viewer's login tokens: show the owner's, or add named and read-only ones
service viewer install|uninstall|start|stop|restart Run the viewer as a background service of its own
update [check|apply|policy|unpin|recover] Check for and install an update (no subcommand), or each step on its own; unpin releases a version pin set by the installer (without turning on automatic updates), recover finishes or rolls back a replacement that was interrupted
completions <shell> Bash, Zsh or Fish completion script

All commands and options: CLI reference.

Run iphone-control update to check for a stable release. When an upgrade is available, it uses the signed update for a managed service, Homebrew for a tap installation, or apt for a Debian package. It reports when you're up to date. Source installations follow the source upgrade instructions.

To check versions, open About & updates in Viewer or run iphone-control update check --json. Managed services can opt in to signed patches while idle with iphone-control update policy auto-patch. Use iphone-control update policy notify to return to checks only. Read the upgrade notes before upgrading.

Uninstall with sh iphone-control-install.sh --uninstall, brew uninstall iphone-control or sudo apt remove iphone-control; your data stays. Settings live in ~/.config/iphone-control/env: the guide writes it, and after editing it by hand run iphone-control service restart — see configuration. All state lives in ~/.local/share/iphone-control: the Apple ID session and signing key, and the passcode if auto-unlock is on. Back it up; never commit or share it.

Documentation

Guide What is it · Use cases & comparison · Limitations · Getting started · AI clients · Tools
Usage Configuration · CLI · Several devices · Several devices at once · Notifications · Auto-unlock · Viewer and remote use
Deployment Install · Build from source · macOS · Data and backups
Problems FAQ · Troubleshooting · Issues · Discussions
Security Security and privacy · SECURITY.md: what is stored, who can reach it, reporting vulnerabilities
Development Contributing · Architecture · Decisions · Changelog
Licensing THIRD_PARTY.md: vendored components, versions and licenses

The architecture and design documents are in Chinese for now.

Warning

This tool can fully control your phone. An agent may tap payment, delete or send buttons — keep tool-call confirmation on in your MCP client. Not affiliated with Apple; use it only with devices and accounts you own. Read SECURITY.md before enabling auto-unlock.

Contributing

Issues and pull requests are welcome — see the contributing guide.

License

MIT. Third-party components: THIRD_PARTY.md.

About

Let AI agents control real iPhones & iPads over USB or Wi-Fi (macOS & Linux). Single Rust binary, MCP server + live viewer — no Xcode, no jailbreak, no Apple ID on iOS 27+.

Topics

Resources

Contributing

Security policy

Stars

224 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages