Control a real USB-connected iPhone from Linux (no Mac, no paid developer account) and expose it to AI agents as MCP tools
Rust ai-agentautomationclaudeclaude-codedockeriosiphonelinuxmcpmcp-servermodel-context-protocolrustwebdriveragent
docs: device control is the core; iOS 27 and later are native (#128)
Qinghe Lif17bc0c0ad10
diff --git a/README.md b/README.mdindex 446d362..78cafe1 100644--- a/README.md+++ b/README.md@@ -4,12 +4,12 @@</a><p align="center">- Let an AI agent operate a real iPhone or iPad plugged into a Linux machine or a Mac — one Rust binary, no Xcode, no paid developer account, no jailbreak.+ Let an AI agent operate a real iPhone or iPad plugged into a Linux machine or a Mac, reliably and fast — one Rust binary, no Xcode, no paid developer account, no jailbreak, and from iOS 27 no Apple ID either.</p><p align="center"><a href="https://github.com/Derrors/iphone-control/releases/latest"><img src="https://img.shields.io/github/v/release/Derrors/iphone-control?style=flat" alt="Release"></a>- <img src="https://img.shields.io/badge/iOS-17%2B-black?style=flat&logo=apple" alt="iOS">+ <img src="https://img.shields.io/badge/iOS-27%2B%20recommended%20%C2%B7%2017%2B%20supported-black?style=flat&logo=apple" alt="iOS: 27+ recommended, 17+ supported"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS-0E7490?style=flat" alt="Platform: Linux | macOS"><img src="https://img.shields.io/badge/MCP-17%20tools-8A2BE2?style=flat" alt="MCP"><a href="Cargo.toml"><img src="https://img.shields.io/badge/Rust-1.89%2B-CE422B?style=flat&logo=rust&logoColor=white" alt="Rust"></a>@@ -38,33 +38,63 @@AI agents can drive browsers and desktops, but a real iPhone is harder: Apple's automation tools need a Mac and Xcode, and the open-source alternatives come as separate pieces that each need their own setup, signing and babysitting.-iphone-control does it all in **one Rust binary** on Linux or macOS, built on [idevice](https://github.com/jkcoxson/idevice), [Impactor](https://github.com/claration/impactor) and [WebDriverAgent](https://github.com/appium/WebDriverAgent). A long-running daemon owns the phone — tunnel, HID session, WebDriverAgent session — and exposes it to Claude Code or any MCP client. It succeeds [iphone-control-toolkit](https://github.com/Derrors/iphone-control-toolkit) and keeps its MCP tools compatible.+iphone-control does it all in **one Rust binary** on Linux or macOS, built on [idevice](https://github.com/jkcoxson/idevice), [Impactor](https://github.com/claration/impactor) and [WebDriverAgent](https://github.com/appium/WebDriverAgent). It succeeds [iphone-control-toolkit](https://github.com/Derrors/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 and serves the MCP tools; recovers from unplugging and reboots; pausing, taking over and confirming 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, act on it, hand out 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.+- **iOS 17–26: WebDriverAgent.** Signed with a free Apple ID, installed on the phone and re-signed before the 7-day profile expires. 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.<p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="website/public/architecture-dark.svg">- <img src="website/public/architecture-light.svg" alt="Architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB through WebDriverAgent, with CoreDevice HID as fallback" width="900">+ <img src="website/public/architecture-light.svg" alt="Architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB, natively on iOS 27 and later and through WebDriverAgent below that" width="900"></picture></p>## Features<p align="center">- <img src="docs/images/features.svg" alt="One binary, 17 MCP tools, fewer round trips, runs unattended, HID fallback, doctor and alerts" width="900">+ <img src="docs/images/features.svg" alt="One binary, 17 MCP tools, fewer round trips, runs unattended, native on iOS 27+, doctor and alerts" width="900"></p>+**Device control (core)**+- **See and touch the screen**: screenshots with region zoom, tap, swipe, long-press, text input (including Chinese), hardware buttons- **Work with UI elements**: read the element tree, tap by text (on a part not covered by floating bars or the keyboard), launch and close apps, open URLs, wait for text to appear-- **Fewer round trips**: any action can return the resulting screen once it has settled, flagging pages still loading and blocking alerts; `iphone_batch` runs up to 20 steps in one call-- **Automatic fallback**: when WebDriverAgent is down, screenshots, taps, swipes and keys switch to Apple's CoreDevice HID service (iOS 27+)-- **Runs unattended**: recovers from replugging, phone reboots and WebDriverAgent crashes; re-signs WebDriverAgent with a free Apple ID before the 7-day profile expires-- **Alerts**: Telegram or Bark notifications when re-signing fails, the Apple ID session expires, the phone goes offline, or a passcode is needed after a reboot+- **Fewer round trips**: any action can return the resulting screen once it has settled, say whether it changed, and flag pages still loading and blocking alerts; `iphone_batch` runs up to 20 steps in one call+- **Runs unattended**: recovers from replugging, phone reboots and lost connections, and keeps serving with the control page closed; a stuck WebDriverAgent is restarted and re-signed before it expires+- **A person stays in charge**: AI tasks can be paused, taken over or stopped at any time; paying, deleting or sending waits for your OK, and an agent can't approve its own task+- **Several devices**: connect several iPhones and iPads and switch which one is controlled- **Optional auto-unlock**: every passcode digit is verified, and a wrong passcode disables auto-unlock after one attempt-- **Diagnostics**: `doctor` checks every layer from USB to WebDriverAgent and tells you how to fix each failure+- **Alerts**: Telegram or Bark notifications when the phone goes offline, a passcode is needed after a reboot, or re-signing fails+- **Diagnostics**: `doctor` checks every layer from USB up and tells you how to fix each failure++**Access**++- **On this machine**: Claude Code, Codex or any MCP client over stdio; `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 video (about 60 fps), otherwise H.264; 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 tasks**: give a task to a local Claude Code or Codex, watch it work and take over at any time## Quick Start-You need an iPhone or iPad on iOS 17+ connected by a **data** cable, a free Apple ID (use a dedicated one), and an Apple Silicon Mac or a Linux machine.+You need an iPhone or iPad (iOS 27+ recommended, iOS 17+ supported) connected by a **data** cable, and an Apple Silicon Mac or a Linux machine. On iOS 26 and earlier you also need a free Apple ID (use a dedicated one) to sign WebDriverAgent.**macOS or Linux, one command** (upstream example; for a fork, use the installer asset from its own signed release)@@ -96,9 +126,9 @@ Connect the phone with the cable and run: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, Apple ID, 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.+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.-Then open a new Claude Code or Codex session and ask, for example, *“Open Clock, switch to the stopwatch and start it.”* Or run `iphone-control viewer` for the control page in the browser (http://127.0.0.1:8200; log in with the link `iphone-control viewer token` prints), where you can act on the live screen and hand tasks to a local Claude Code or Codex; it works from the local network and other machines too, see [Viewer and Remote Use](https://derrors.github.io/iphone-control/en/guide/remote).+Then open a new Claude Code or Codex session and ask, for example, *“Open Clock, switch to the stopwatch and start it.”* That is device control, complete; the control page is optional. To watch the phone in a browser, run `iphone-control viewer` for the control page in the browser (http://127.0.0.1:8200; log in with the link `iphone-control viewer token` prints), where you can act on the live screen and hand tasks to a local Claude Code or Codex; it works from the local network and other machines too, see [Viewer and Remote Use](https://derrors.github.io/iphone-control/en/guide/remote).More: [step-by-step guide](https://derrors.github.io/iphone-control/en/guide/getting-started) · [build from source](https://derrors.github.io/iphone-control/en/deploy/source) · [macOS guide](https://derrors.github.io/iphone-control/en/deploy/macos) · [other MCP clients](https://derrors.github.io/iphone-control/en/guide/mcp-clients).@@ -137,15 +167,15 @@ Tool texts, results, CLI output and logs are in Simplified Chinese by default; s| `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 |-| `sign` | Sign and install WebDriverAgent now |-| `resign [--force]` | Re-sign WebDriverAgent if it expires soon (or now) |+| `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 connected devices / switch which one is controlled || `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 |+| `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`, `pause`, `approve`… follow 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 |diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 923c58a..13c91be 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -4,12 +4,12 @@</a><p align="center">- 让 AI agent 操作一台接在 Linux 或 Mac 上的真实 iPhone 或 iPad:一个 Rust 二进制,不需要 Xcode,不需要付费开发者账号,不越狱。+ 让 AI agent 稳定、高效地操作一台接在 Linux 或 Mac 上的真实 iPhone 或 iPad:一个 Rust 二进制,不需要 Xcode,不需要付费开发者账号,不越狱;iOS 27 起连 Apple ID 都不用。</p><p align="center"><a href="https://github.com/Derrors/iphone-control/releases/latest"><img src="https://img.shields.io/github/v/release/Derrors/iphone-control?style=flat" alt="Release"></a>- <img src="https://img.shields.io/badge/iOS-17%2B-black?style=flat&logo=apple" alt="iOS">+ <img src="https://img.shields.io/badge/iOS-27%2B%20%E6%8E%A8%E8%8D%90%20%C2%B7%2017%2B%20%E5%8F%AF%E7%94%A8-black?style=flat&logo=apple" alt="iOS:推荐 27+,17+ 可用"><img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS-0E7490?style=flat" alt="平台:Linux | macOS"><img src="https://img.shields.io/badge/MCP-17%20tools-8A2BE2?style=flat" alt="MCP"><a href="Cargo.toml"><img src="https://img.shields.io/badge/Rust-1.89%2B-CE422B?style=flat&logo=rust&logoColor=white" alt="Rust"></a>@@ -38,33 +38,63 @@AI agent 已经能操作浏览器和电脑桌面,但真实的 iPhone 难得多:苹果的自动化工具需要 Mac 和 Xcode,开源替代品又是零散的几块,每一块都要单独安装、签名、看护。-iphone-control 在 Linux 或 macOS 上用**一个 Rust 二进制**把这些事都做了,基于 [idevice](https://github.com/jkcoxson/idevice)、[Impactor](https://github.com/claration/impactor) 和 [WebDriverAgent](https://github.com/appium/WebDriverAgent)。一个常驻守护进程独占手机(隧道、HID 会话、WebDriverAgent 会话常驻复用),把它交给 Claude Code 或任何 MCP 客户端。它是 [iphone-control-toolkit](https://github.com/Derrors/iphone-control-toolkit) 的继任者,MCP 工具保持兼容。+iphone-control 在 Linux 或 macOS 上用**一个 Rust 二进制**把这些事都做了,基于 [idevice](https://github.com/jkcoxson/idevice)、[Impactor](https://github.com/claration/impactor) 和 [WebDriverAgent](https://github.com/appium/WebDriverAgent)。它是 [iphone-control-toolkit](https://github.com/Derrors/iphone-control-toolkit) 的继任者,MCP 工具保持兼容。++它分三层,核心是设备控制:++| 层 | 做什么 | 要不要开控制台 |+| --- | --- | --- |+| **设备控制**(核心) | 常驻守护进程独占手机,提供 MCP 工具;断线、重启后自动恢复;AI 任务的暂停、接管和人工确认 | 不要 |+| **接入** | 本机的 AI 客户端经 stdio 接入;别的机器经 HTTP MCP(`/mcp`)、`mcp --url` 接入 | 本机不要,远程要开控制台服务 |+| **控制台**(可选) | 浏览器里看实时画面、直接操作、下达 AI 任务 | 就是它 |++设备控制有两条路线,按 iOS 版本自动选:++- **iOS 27 及以上:原生控制(默认)**。读界面用系统的无障碍服务,点按、滑动、按键走 HID,启动 App 走 CoreDevice。手机上什么都不装,不用 Apple ID、不用签名,几秒就绪。+- **iOS 17–26:WebDriverAgent**。用免费 Apple ID 签名后装到手机上,7 天到期前自动重签。这条路线继续维护。++> [!TIP]+> **推荐用 iOS 27 及以上的设备**,或者把手机升级到 iOS 27:不用登录 Apple ID、不用签名,重启后也不用在手机上输「UI 自动化」的密码,更没有签名过期、证书被吊销、WebDriverAgent 卡死这类问题。<p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="website/public/architecture-dark.svg">- <img src="website/public/architecture-light.svg" alt="架构:MCP 客户端经 stdio 调用 iphone-control mcp,再经 Unix socket 交给守护进程;守护进程经 USB 用 WebDriverAgent 操作 iPhone 或 iPad,CoreDevice HID 作为后备" width="900">+ <img src="website/public/architecture-light.svg" alt="架构:MCP 客户端经 stdio 调用 iphone-control mcp,再经 Unix socket 交给守护进程;守护进程经 USB 操作 iPhone 或 iPad,iOS 27 起用原生控制,更低的版本用 WebDriverAgent" width="900"></picture></p>## 功能特性<p align="center">- <img src="docs/images/features.zh-CN.svg" alt="一个二进制、17 个 MCP 工具、少走往返、无人值守、HID 后备、诊断与通知" width="900">+ <img src="docs/images/features.zh-CN.svg" alt="一个二进制、17 个 MCP 工具、少走往返、无人值守、iOS 27 原生控制、诊断与通知" width="900"></p>+**设备控制(核心)**+- **看屏幕、点屏幕**:截图(可放大某块区域)、点击、滑动、长按、输入文字(支持中文)、硬件按键- **按界面元素操作**:读元素树、按文字点击(自动避开悬浮栏、键盘挡住的部分)、启动和结束 App、打开链接、等某段文字出现-- **省往返**:任何操作都可以等界面稳定后顺带返回操作后的样子,并提示页面是否还在加载、有没有弹窗挡着;`iphone_batch` 一次执行最多 20 步-- **自动后备**:WebDriverAgent 不可用时,截图、点击、滑动、按键改走苹果的 CoreDevice HID 服务(iOS 27 起)-- **无人值守**:拔插、手机重启、WebDriverAgent 崩溃后自动恢复;用免费 Apple ID 签名,7 天描述文件过期前自动重签-- **告警通知**:重签失败、Apple ID 会话失效、手机离线、重启后需要输密码时,经 Telegram 或 Bark 推送+- **省往返**:任何操作都可以等界面稳定后顺带返回操作后的样子,说明界面变没变,并提示页面是否还在加载、有没有弹窗挡着;`iphone_batch` 一次执行最多 20 步+- **无人值守**:拔插、手机重启、连接中断后自动恢复,不开控制台也一直提供服务;WebDriverAgent 卡死会被重启,签名到期前自动重签+- **人工把关**:AI 任务可以随时暂停、接管、停止;付款、删除、发消息之前要你确认,Agent 不能批准自己的任务+- **多台设备**:接多台 iPhone / iPad,随时切换控制哪一台- **可选的自动解锁**:每输一位都核对,密码错了只试一次就停用-- **诊断**:`doctor` 从 USB 到 WebDriverAgent 逐层检查,每项失败都告诉你怎么修+- **告警通知**:手机离线、重启后需要输密码、重签失败时,经 Telegram 或 Bark 推送+- **诊断**:`doctor` 从 USB 起逐层检查,每项失败都告诉你怎么修++**接入**++- **本机**:Claude Code、Codex 或任何 MCP 客户端经 stdio 接入;`task run` 让任何 agent 平台在任务里运行,你能看到每一步+- **远程**:控制台服务同一端口上有 HTTP MCP(`/mcp`),对局域网开放时走 HTTPS、要登录令牌(可以是只读的);`mcp --url`、`task --url` 操作另一台机器上的手机++**控制台(可选)**++- **实时画面**:iOS 27 起直接用手机自己的视频(约每秒 60 帧),其他情况用 H.264;有弱网模式+- **直接操作**:鼠标像手指一样点按、拖动;看不到的系统弹窗画在画面上,也能点+- **下达任务**:把任务交给本机的 Claude Code 或 Codex,看着它做,随时接管## 快速开始-需要一部 iOS 17 以上的 iPhone 或 iPad 和能**传数据**的线、一个免费 Apple ID(建议专门注册一个),以及一台 Apple Silicon 的 Mac 或一台 Linux 机器。+需要一部 iPhone 或 iPad(推荐 iOS 27 及以上,iOS 17 起都能用)和能**传数据**的线,以及一台 Apple Silicon 的 Mac 或一台 Linux 机器。iOS 26 及以下还要一个免费 Apple ID(建议专门注册一个),用来给 WebDriverAgent 签名。**macOS 或 Linux,一行命令安装**@@ -98,9 +128,9 @@ Linux 上要用系统的 usbmuxd(`sudo apt install usbmuxd`,.deb 会自动iphone-control```-第一次运行时,它在终端里一步步带你完成设置:语言、代理、后台服务、配对、开发者模式、Apple ID、签名并安装 WebDriverAgent,可选的自动解锁和通知,最后注册到 Claude Code 和 Codex。按提示在手机上操作即可。做过的步骤会跳过;设置好以后再运行 `iphone-control` 只显示状态。+第一次运行时,它在终端里一步步带你完成设置:语言、代理、后台服务、配对、开发者模式(iOS 26 及以下还有 Apple ID、签名并安装 WebDriverAgent),可选的自动解锁和通知,最后注册到 Claude Code 和 Codex。按提示在手机上操作即可。做过的步骤会跳过;设置好以后再运行 `iphone-control` 只显示状态。-然后打开一个新的 Claude Code 或 Codex 会话,试着说:「打开时钟,切到秒表并启动」。也可以运行 `iphone-control viewer` 打开浏览器里的控制台(http://127.0.0.1:8200,用 `iphone-control viewer token` 打印的链接登录),在实时画面上直接操作,或把任务交给本机的 Claude Code 或 Codex;局域网和别的机器也能用,见[控制台与远程使用](https://derrors.github.io/iphone-control/guide/remote)。+然后打开一个新的 Claude Code 或 Codex 会话,试着说:「打开时钟,切到秒表并启动」。到这里设备控制就完整可用了,控制台不是必需的。想在浏览器里看着手机,可以运行 `iphone-control viewer` 打开浏览器里的控制台(http://127.0.0.1:8200,用 `iphone-control viewer token` 打印的链接登录),在实时画面上直接操作,或把任务交给本机的 Claude Code 或 Codex;局域网和别的机器也能用,见[控制台与远程使用](https://derrors.github.io/iphone-control/guide/remote)。更多:[分步指南](https://derrors.github.io/iphone-control/guide/getting-started) · [从源码编译](https://derrors.github.io/iphone-control/deploy/source) · [macOS 指南](https://derrors.github.io/iphone-control/deploy/macos) · [其他 MCP 客户端](https://derrors.github.io/iphone-control/guide/mcp-clients)@@ -139,15 +169,15 @@ iphone-control| `mcp [--url <控制台>]` | MCP 服务,由 AI 客户端拉起;加 `--url` 时转接到另一台机器的控制台 || `status` | 守护进程状态、描述文件还剩多久、最近日志 || `doctor` | 逐层诊断,每项失败都给出修复办法 |-| `login` | Apple ID 会话失效时重新登录 |-| `sign` | 立即签名并安装 WebDriverAgent |-| `resign [--force]` | 快过期才重签 WebDriverAgent(或立即重签) |+| `login` | Apple ID 会话失效时重新登录(只有用 WebDriverAgent 的设备需要) |+| `sign` | 立即签名并安装 WebDriverAgent(同上) |+| `resign [--force]` | 快过期才重签 WebDriverAgent(或立即重签)(同上) || `passcode set\|clear` | 开启或关闭一台设备的自动解锁(密码按设备分开存) || `unlock-reset` | 自动解锁被停用后恢复 || `devices` / `select <UDID\|设备名\|auto>` | 列出接着的设备 / 切换控制哪一台 || `notify-test [事件]` | 发送测试通知 || `mcp-config` | 打印注册 MCP 的命令 |-| `wda-bridge [--port]` | 把 WebDriverAgent 桥接到 127.0.0.1 给别的工具用,用完就停 |+| `wda-bridge [--port]` | 把 WebDriverAgent 桥接到 127.0.0.1 给别的工具用,用完就停(只用于 WebDriverAgent 设备) || `viewer [--port] [--lan]` | 控制台页面,地址 127.0.0.1:8200,要登录(`viewer token` 显示令牌和登录链接,可以加只读令牌):实时画面可直接点击、滑动、输入,设备面板,还能把任务交给本机的 Claude Code 或 Codex 执行。`--lan` 对局域网开放(HTTPS),同一个端口上还有 MCP over HTTP(`/mcp`) || `task run [--url <控制台>] -- <命令>` | 给别的 agent 平台用的 AI 任务;`--url` 时手机在另一台机器上。`task list`、`pause`、`approve` 等查看和控制任务 || `viewer token [add <名字> [--read-only]\|list\|show <名字>\|remove <名字>]` | 控制台的登录令牌:显示 owner 的令牌,或者加有名字的、只读的令牌 |diff --git a/docs/images/features.svg b/docs/images/features.svgindex 3d22e95..432d7e9 100644--- a/docs/images/features.svg+++ b/docs/images/features.svg@@ -1,4 +1,4 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 388" width="1200" height="388" role="img" aria-label="One binary: Linux or macOS. No Xcode, no paid developer account, no jailbreak.; 17 MCP tools: Screenshots, taps, swipes, text input, buttons, apps, URLs, element tree.; Fewer round trips: Actions return the settled screen; iphone_batch runs 20 steps per call.; Runs unattended: Recovers from replugs and reboots; re-signs WDA before it expires.; HID fallback: Screenshots, taps and keys keep working via CoreDevice (iOS 27+).; doctor and alerts: Checks every layer from USB to WDA; Telegram or Bark when it needs you.">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 388" width="1200" height="388" role="img" aria-label="One binary: Linux or macOS. No Xcode, no paid developer account, no jailbreak.; 17 MCP tools: Screenshots, taps, swipes, text input, buttons, apps, URLs, element tree.; Fewer round trips: Actions return the settled screen; iphone_batch runs 20 steps per call.; Runs unattended: Recovers from replugs and reboots, with or without the control page.; Native on iOS 27+: No WDA, no Apple ID, no signing; ready in seconds. Older iOS: WDA.; doctor and alerts: Checks every layer from USB up; Telegram or Bark when it needs you."><defs><linearGradient id="cd-bg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#0f1b2d"/>@@ -39,23 +39,23 @@<rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><path d="M35 24 A11 11 0 1 1 31.8 16.2" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round"/><polyline points="33,9 33,17 25,17" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></g><text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">Runs unattended</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">Recovers from replugs and reboots;</text>- <text x="24" y="155" font-size="15" fill="#94a3b8">re-signs WDA before it expires.</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">Recovers from replugs and reboots,</text>+ <text x="24" y="155" font-size="15" fill="#94a3b8">with or without the control page.</text></g><g transform="translate(412 212)"><rect x="0.5" y="0.5" width="375" height="175" rx="18" fill="url(#cd-bg)" stroke="#155e75" stroke-opacity="0.7"/><rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><path d="M24 11 L37 18 L24 25 L11 18 Z" fill="#fff"/><polyline points="11,24 24,31 37,24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><polyline points="11,30 24,37 37,30" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-opacity="0.6"/></g>- <text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">HID fallback</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">Screenshots, taps and keys keep</text>- <text x="24" y="155" font-size="15" fill="#94a3b8">working via CoreDevice (iOS 27+).</text>+ <text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">Native on iOS 27+</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">No WDA, no Apple ID, no signing;</text>+ <text x="24" y="155" font-size="15" fill="#94a3b8">ready in seconds. Older iOS: WDA.</text></g><g transform="translate(824 212)"><rect x="0.5" y="0.5" width="375" height="175" rx="18" fill="url(#cd-bg)" stroke="#155e75" stroke-opacity="0.7"/><rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><polyline points="9,25 17,25 21,14 27,34 31,25 39,25" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></g><text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">doctor and alerts</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">Checks every layer from USB to WDA;</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">Checks every layer from USB up;</text><text x="24" y="155" font-size="15" fill="#94a3b8">Telegram or Bark when it needs you.</text></g></g>diff --git a/docs/images/features.zh-CN.svg b/docs/images/features.zh-CN.svgindex 20a5ef8..515eb70 100644--- a/docs/images/features.zh-CN.svg+++ b/docs/images/features.zh-CN.svg@@ -1,4 +1,4 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 388" width="1200" height="388" role="img" aria-label="一个二进制: Linux 或 macOS 上直接运行 不需要 Xcode、付费账号,不越狱; 17 个 MCP 工具: 截图、点击、滑动、输入中文 按键、管理 App、读元素树; 少走往返: 操作后顺带返回稳定后的界面 iphone_batch 一次最多 20 步; 无人值守: 拔插、重启、WDA 崩溃后自动恢复 描述文件到期前自动重签; HID 后备: WDA 不可用时截图、点击、按键 改走 CoreDevice(iOS 27+); 诊断与通知: doctor 从 USB 到 WDA 逐层检查 需要你时发 Telegram 或 Bark">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 388" width="1200" height="388" role="img" aria-label="一个二进制: Linux 或 macOS 上直接运行 不需要 Xcode、付费账号,不越狱; 17 个 MCP 工具: 截图、点击、滑动、输入中文 按键、管理 App、读元素树; 少走往返: 操作后顺带返回稳定后的界面 iphone_batch 一次最多 20 步; 无人值守: 拔插、重启、断连后自动恢复 不开控制台也一直提供服务; iOS 27 原生控制: 不装 WDA、不用 Apple ID 和签名 几秒就绪;低版本用 WDA; 诊断与通知: doctor 从 USB 起逐层检查 需要你时发 Telegram 或 Bark"><defs><linearGradient id="cd-bg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#0f1b2d"/>@@ -39,23 +39,23 @@<rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><path d="M35 24 A11 11 0 1 1 31.8 16.2" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round"/><polyline points="33,9 33,17 25,17" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></g><text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">无人值守</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">拔插、重启、WDA 崩溃后自动恢复</text>- <text x="24" y="155" font-size="15" fill="#94a3b8">描述文件到期前自动重签</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">拔插、重启、断连后自动恢复</text>+ <text x="24" y="155" font-size="15" fill="#94a3b8">不开控制台也一直提供服务</text></g><g transform="translate(412 212)"><rect x="0.5" y="0.5" width="375" height="175" rx="18" fill="url(#cd-bg)" stroke="#155e75" stroke-opacity="0.7"/><rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><path d="M24 11 L37 18 L24 25 L11 18 Z" fill="#fff"/><polyline points="11,24 24,31 37,24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><polyline points="11,30 24,37 37,30" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-opacity="0.6"/></g>- <text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">HID 后备</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">WDA 不可用时截图、点击、按键</text>- <text x="24" y="155" font-size="15" fill="#94a3b8">改走 CoreDevice(iOS 27+)</text>+ <text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">iOS 27 原生控制</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">不装 WDA、不用 Apple ID 和签名</text>+ <text x="24" y="155" font-size="15" fill="#94a3b8">几秒就绪;低版本用 WDA</text></g><g transform="translate(824 212)"><rect x="0.5" y="0.5" width="375" height="175" rx="18" fill="url(#cd-bg)" stroke="#155e75" stroke-opacity="0.7"/><rect x="24" y="24" width="48" height="48" rx="12" fill="url(#cd-icon)"/><g transform="translate(24 24)"><polyline points="9,25 17,25 21,14 27,34 31,25 39,25" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/></g><text x="24" y="104" font-size="22" font-weight="700" fill="#f0f9ff">诊断与通知</text>- <text x="24" y="132" font-size="15" fill="#94a3b8">doctor 从 USB 到 WDA 逐层检查</text>+ <text x="24" y="132" font-size="15" fill="#94a3b8">doctor 从 USB 起逐层检查</text><text x="24" y="155" font-size="15" fill="#94a3b8">需要你时发 Telegram 或 Bark</text></g></g>diff --git a/website/deploy/backup.md b/website/deploy/backup.mdindex 9924ac4..0378d43 100644--- a/website/deploy/backup.md+++ b/website/deploy/backup.md@@ -4,8 +4,8 @@| 路径 | 内容 | 丢了会怎样 ||---|---|---|-| `account/` | Apple ID 会话、开发签名私钥和证书 | 要重新登录;会生成新证书 |-| `wda/` | 签好的 WebDriverAgent | 自动重签 |+| `account/` | Apple ID 会话、开发签名私钥和证书(只有用 WDA 时有) | 要重新登录;会生成新证书 |+| `wda/` | 签好的 WebDriverAgent(只有用 WDA 时有) | 自动重签 || `ddi/` | 开发者镜像缓存 | 自动重新下载 || `secrets/passcodes/` | 各设备的锁屏密码(仅开启自动解锁时) | 要重新 `passcode set` || `viewer-tokens.json` | 控制台的登录令牌(像密码一样保管,别放进会同步到别处的备份) | 控制台第一次启动时生成新的 `owner`;之前的令牌、登录过的浏览器和 MCP 客户端都要换新的 |diff --git a/website/deploy/macos.md b/website/deploy/macos.mdindex 57bc4e7..a778db3 100644--- a/website/deploy/macos.md+++ b/website/deploy/macos.md@@ -9,8 +9,8 @@ iphone-control 也能直接跑在 Mac 上:用 macOS 自带的 usbmuxd,不需## 需要- Apple Silicon 的 Mac。用脚本安装时,PATH 中需要有 Python 3 和 OpenSSL 3。Intel Mac 要从源码编译,需 Xcode 命令行工具和 Rust 1.89 以上。-- 一部 iOS 17 以上的 iPhone 或 iPad,用能**传数据**的线连接-- 一个免费 Apple ID(建议专门注册一个)+- 一部 iPhone 或 iPad,用能**传数据**的线连接。推荐 iOS 27 及以上(原生控制);iOS 17 起都能用+- iOS 26 及以下还要一个免费 Apple ID(建议专门注册一个)## 安装@@ -57,7 +57,7 @@ iphone-control --versioniphone-control```-第一次运行会一步步带你完成设置:语言、代理、后台服务、配对、开发者模式、Apple ID、签名安装 WDA、自动解锁和通知(可选)、注册到 Claude Code 和 Codex。手机上要做的事见[快速开始](../guide/getting-started#first-run)。如果这部手机已经在 Finder 里信任过这台 Mac,配对这一步会直接显示「已配对」。设置好以后再运行 `iphone-control` 只显示状态。+第一次运行会一步步带你完成设置:语言、代理、后台服务、配对、开发者模式(iOS 26 及以下还有 Apple ID、签名安装 WDA)、自动解锁和通知(可选)、注册到 Claude Code 和 Codex。手机上要做的事见[快速开始](../guide/getting-started#first-run)。如果这部手机已经在 Finder 里信任过这台 Mac,配对这一步会直接显示「已配对」。设置好以后再运行 `iphone-control` 只显示状态。### 手动做@@ -131,7 +131,7 @@ iphone-control service restartrm -rf ~/.local/share/iphone-control ~/.config/iphone-control # 会删掉 Apple ID 会话和签好的 WDA```-手机上删除 WebDriverAgent 这个 App,「VPN 与设备管理」里的描述文件会随它一起消失。+用过 WDA 的话,在手机上删除 WebDriverAgent 这个 App,「VPN 与设备管理」里的描述文件会随它一起消失。## 已知差异diff --git a/website/en/deploy/backup.md b/website/en/deploy/backup.mdindex 357c7d6..54c68ad 100644--- a/website/en/deploy/backup.md+++ b/website/en/deploy/backup.md@@ -4,8 +4,8 @@| Path | Contents | If lost ||---|---|---|-| `account/` | Apple ID session, signing key and certificate | Log in again; a new certificate is created |-| `wda/` | Signed WebDriverAgent | Re-signed automatically |+| `account/` | Apple ID session, signing key and certificate (WDA only) | Log in again; a new certificate is created |+| `wda/` | Signed WebDriverAgent (WDA only) | Re-signed automatically || `ddi/` | Developer Disk Image cache | Downloaded again || `secrets/passcodes/` | Per-device passcodes (only with auto-unlock) | Run `passcode set` again || `viewer-tokens.json` | The viewer's login tokens (keep them like passwords, out of backups that sync elsewhere) | The viewer makes a new `owner` on its next start; browsers and MCP clients that logged in need the new one |diff --git a/website/en/deploy/macos.md b/website/en/deploy/macos.mdindex 3b2178f..bbb34e5 100644--- a/website/en/deploy/macos.md+++ b/website/en/deploy/macos.md@@ -9,8 +9,8 @@ Verified on a MacBook Pro (Apple M3 Pro) / macOS 26.6.2 with an iPhone 15 Pro Ma## You need- An Apple Silicon Mac. The script installer requires Python 3 and OpenSSL 3 on PATH. Intel Macs have no prebuilt package and build from source (Xcode Command Line Tools and Rust 1.89+). Full Xcode is **not** needed-- An iPhone or iPad on iOS 17+, connected with a cable that carries **data**-- A free Apple ID (a dedicated one is recommended)+- An iPhone or iPad, connected with a cable that carries **data**. iOS 27 or later is recommended (native control); iOS 17 and later work+- On iOS 26 and earlier, a free Apple ID (a dedicated one is recommended)## Install@@ -57,7 +57,7 @@ Connect the phone with a cable, then:iphone-control```-The first run walks you through setup step by step: language, proxy, background service, pairing, Developer Mode, Apple ID, signing and installing WDA, auto-unlock and notifications (optional), and registering with Claude Code and Codex. What to do on the phone is in [Getting Started](../guide/getting-started#first-run). If the phone already trusts this Mac (from Finder), the pairing step just says it is paired. Once set up, running `iphone-control` again only shows the status.+The first run walks you through setup step by step: language, proxy, background service, pairing, Developer Mode (and on iOS 26 and earlier, Apple ID and signing and installing WDA), auto-unlock and notifications (optional), and registering with Claude Code and Codex. What to do on the phone is in [Getting Started](../guide/getting-started#first-run). If the phone already trusts this Mac (from Finder), the pairing step just says it is paired. Once set up, running `iphone-control` again only shows the status.### Doing it by hand@@ -131,7 +131,7 @@ All of them keep your data and settings. To remove them too:rm -rf ~/.local/share/iphone-control ~/.config/iphone-control # deletes the Apple ID session and signed WDA```-On the phone, delete the WebDriverAgent app; its profile under *VPN & Device Management* goes with it.+If WDA was used, delete the WebDriverAgent app on the phone; its profile under *VPN & Device Management* goes with it.## Known differencesdiff --git a/website/en/guide/auto-unlock.md b/website/en/guide/auto-unlock.mdindex aa6791f..1ee2c01 100644--- a/website/en/guide/auto-unlock.md+++ b/website/en/guide/auto-unlock.md@@ -1,6 +1,6 @@# Auto-unlock-Off by default. When enabled, MCP actions unlock the phone with your saved passcode if it is locked, and so do the read-only screenshot, element-list and `iphone_wait_for` tools. Nothing is unlocked while WDA is unavailable.+Off by default. When enabled, MCP actions unlock the phone with your saved passcode if it is locked, and so do the read-only screenshot, element-list and `iphone_wait_for` tools. Native control (iOS 27 and later) follows the same rules as WDA; a device on WDA isn't unlocked while WDA is unavailable.::: danger Understand the risk firstThe passcode is stored **in plain text** in the data directory. Anyone who can log in to the host, read backups of the data directory, or call this MCP server can unlock your phone. Only enable it on a host you fully control, preferably with a phone dedicated to automation.diff --git a/website/en/guide/cli.md b/website/en/guide/cli.mdindex 56f7541..7865b84 100644--- a/website/en/guide/cli.md+++ b/website/en/guide/cli.md@@ -85,10 +85,10 @@ These commands find the service set up by the one-command install, `iphone-contr| Command | What it does ||---|---|-| `setup` | Runs the whole guide again: language, proxy, background service, pairing, Developer Mode, Apple ID, signing and installing WDA, auto-unlock, notifications, MCP registration. Done steps are skipped. The phone part only acts on the controlled device |+| `setup` | Runs the whole guide again: language, proxy, background service, pairing, Developer Mode, Apple ID, signing and installing WDA, auto-unlock, notifications, MCP registration. Done steps are skipped; on iOS 27 and later (native control) the Apple ID and WDA steps are too. The phone part only acts on the controlled device || `setup --reconfigure` | Set up one part again, picked from a menu: all of it, language, proxy, background service, Apple ID (sign in again and re-sign WDA), phone (pairing, Developer Mode, WDA), auto-unlock passcode, notifications, MCP registration (Claude Code, Codex) |-| `login [email]` | Sign in to the Apple ID. The password and code are only typed here; without an email it asks for one |-| `sign` | Sign and install WDA now, same as `resign --force`. Registers the device with the Apple ID |+| `login [email]` | Sign in to the Apple ID (devices on WDA only). The password and code are only typed here; without an email it asks for one |+| `sign` | Sign and install WDA now (devices on WDA only), same as `resign --force`. Registers the device with the Apple ID || `resign [--force]` | Re-sign only when fewer than `RESIGN_MIN_DAYS` days remain; `--force` re-signs now. Without `--force` it doesn't register a device that has never had WDA |In setup menus, use ↑/↓ to move and Enter to confirm, or type a number and press Enter. Confirmation prompts also accept ←/→. Esc dismisses the guide. Ctrl+C interrupts it with exit status 130. Both preserve saved steps. A `>` marker identifies the selection without relying on color. After resizing the terminal, the next key redraws the menu at the new width.@@ -129,7 +129,7 @@ See [Auto-unlock](./auto-unlock). `--device` takes a UDID or name, and the devic| Command | What it does ||---|---|| `notify-test [event]` | Send test notifications: one per event type, or one type (`resign`, `session`, `pin`, `pin-recovered`, `unlock`, `offline`, `online`) |-| `wda-bridge [--port <port>]` | Expose WDA on `127.0.0.1` (default port 8100) for other tools. WDA has no authentication and every local user can reach it, so stop it when done |+| `wda-bridge [--port <port>]` | Expose WDA on `127.0.0.1` (devices on WDA only) (default port 8100) for other tools. WDA has no authentication and every local user can reach it, so stop it when done || `viewer [--port <port>] [--lan] [--lan-host <name>…] [--tls auto\|on\|off] [--tls-cert <PEM> --tls-key <PEM>] [--mcp on\|off]` | Control page in the browser, **behind a login**: every HTTP visit (from this machine too; one forwarded by frp or another reverse proxy looks just like it) needs the token, and `viewer token` shows it with links that log in; a browser stays logged in for 30 days, programs and MCP clients send `Authorization: Bearer <token>`. The same port also serves MCP over HTTP at `/mcp` (see [Connect an AI Client](./mcp-clients#connect-by-url-http); `--mcp off` turns it off). The page is at `http://127.0.0.1:8200/` (default port); with `--lan` also at `https://<this machine's address>:8200/` on the local network (same port; `http://` from the network is sent to `https://`). The certificate is a self-signed one made on this machine (kept in `viewer-tls/` in the data directory and reused), so the first time the browser warns that it isn't trusted: check that the SHA-256 fingerprint matches the one printed at startup or by `service status`, then go on. With a certificate of your own (`--tls-cert`/`--tls-key`: mkcert, `tailscale cert`…) there is no warning. With `--tls off` the network gets plain HTTP and the picture falls back to MJPEG (browsers only offer WebCodecs on localhost or HTTPS). The page is in English or Chinese (follows `IPHONE_CONTROL_LANG`, switchable on the page). **Screen:** the live picture works like a touchscreen: click to tap, drag to swipe, hold to long-press, scroll with the mouse wheel or trackpad, plus a text field and the hardware buttons. On iOS 27 and later the finger follows the pointer as it moves (over CoreDevice HID, which keeps the phone awake until 30 seconds after the last touch); older versions get the whole gesture on release. Everything goes through the daemon like an MCP call, so it queues with the agent and unlocks the phone first. On iOS 27 and later the picture is the phone's own video; otherwise it comes from WDA (none until WDA is ready), as H.264 or MJPEG; see [Picture](#viewer-picture) below. Touch is available when the frame matches the measured size and orientation. After rotating or switching devices, start a new gesture on the updated picture. Settings at the bottom of the sidebar controls the theme and text size. The picture has its own zoom controls, the − and + above it (pinching doesn't zoom, so a drag can't turn into one). **Device panel:** state and readiness checks, installed apps, on-screen elements. The page follows the device the daemon controls: switch on the page or anywhere else, and the picture and panels move over; see [Several Devices](./multi-device#control-page). **AI tasks:** type a task and a local agent carries it out (Claude Code or Codex, whichever is on `PATH`; picked on the page). Before it starts you can limit it to some apps with the App button next to the agent; in any other app each step waits for you. You can pause, take over and hand back, or stop it, and it asks on the page before paying, deleting or sending messages. The token is the key: keep it to yourself. See [Viewer and Remote Use](./remote) || `viewer token [--new]` | Show the viewer's `owner` login token, links that log in on this machine and the local network, and the command to connect to its HTTP MCP; `--new` replaces it: browsers and MCP clients that used the old one need the new one. Tokens are kept in `viewer-tokens.json` in the data directory (0600); changes take effect at once, without restarting the viewer || `viewer token add <name> [--read-only]`, `list`, `show <name> [--new]`, `remove <name>` | Named tokens, one per person or device, say; the page's task log records which token paused, took over or confirmed. A `--read-only` token can watch the picture, the device's state and tasks; every action is refused and the page hides them. `list` doesn't show the tokens themselves; the last token that may operate stays |@@ -156,5 +156,5 @@ On macOS, and on Linux with ffmpeg installed, the control page's picture is H.26- **Slow links:** the page tells viewer every 100 ms how much it has received. When the link can't keep up, fewer frames are encoded: the frame rate drops, but the picture doesn't fall further and further behind. On a 200 KB/s link, for example, the picture catches up about 0.6 s after scrolling stops.- **Falling back to MJPEG:** on Linux without ffmpeg, without a working encoder, or in a browser without WebCodecs (older ones), the page uses MJPEG. It no longer repeats the same frame while the screen is still, and on a slow link it only sends the newest frame.- **Low-bandwidth mode:** a switch in the control page's Settings, for use over the internet or a weak signal. About half the picture's traffic at the same frame rate; a still screen looks the same, while things move edges get a little blocky, clear again about half a second after they stop. The phone's own video (HEVC) is one stream per phone, its bitrate cap agreed with the phone when it starts, so while the mode is on every page watching that phone gets it (a 6 Mbit/s cap becomes 2 Mbit/s), and the first page to turn it on and the last to turn it off interrupt everyone's picture for about half a second and end a touch under way. H.264 only changes for the page that turned it on (qp 26). While it is on, the line under the picture says "Low-bandwidth mode".-- **Which one is in use:** shown under the picture, e.g. "Live · WDA · HEVC iPhone 312 KB/s" (the phone's own video) or "Live · WDA · H.264 VAAPI 254 KB/s".+- **Which one is in use:** shown under the picture, e.g. "Live · Native · HEVC iPhone 312 KB/s" (native control, the phone's own video), "Live · WDA · HEVC iPhone 312 KB/s" or "Live · WDA · H.264 VAAPI 254 KB/s".- **Settings:** `IPHONE_CONTROL_VIEWER_CODEC` (`device`: only the phone's own video, `mjpeg`: only MJPEG), `IPHONE_CONTROL_VIEWER_QP`, `ICTL_FFMPEG`, see [Configuration](./configuration). On Linux install ffmpeg with `sudo apt install ffmpeg`; the .deb recommends it. Nothing to install on macOS.diff --git a/website/en/guide/getting-started.md b/website/en/guide/getting-started.mdindex 5bd34e0..34b8caf 100644--- a/website/en/guide/getting-started.md+++ b/website/en/guide/getting-started.md@@ -5,8 +5,8 @@ Install the program, plug in the phone, run `iphone-control` and follow the guid## You need- A host: a Mac with Apple silicon, or Linux (x86_64, aarch64)-- An iPhone or iPad (iOS 17+) and a cable that carries data-- A free Apple ID (a dedicated one is recommended)+- 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@@ -77,6 +77,8 @@ iphone-controlThe 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 |@@ -85,9 +87,10 @@ The first time, it walks you through setup step by step. Steps that are already| 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 | In the terminal, enter the Apple ID, password and two-factor code |-| Sign and install WDA | Keep the phone unlocked |-| Waiting for WDA | 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 |+| 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](./auto-unlock) || Notifications (optional) | Pick Bark or Telegram and enter the key or token; a test message is sent. See [Notifications](./notifications) || MCP registration | If Claude Code or Codex is found, press Enter to register with it |@@ -120,7 +123,7 @@ The page needs a login, on this machine too; a browser stays logged in for 30 da## Checking on it```bash-iphone-control status # state, signing time left, recent log+iphone-control status # state, native or WDA, recent logiphone-control doctor # layer-by-layer checks with a fix for each failure```@@ -135,4 +138,4 @@ Something wrong? See the [FAQ](../troubleshoot/faq).| 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 remove WebDriverAgent on the phone.+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.diff --git a/website/en/guide/multi-device.md b/website/en/guide/multi-device.mdindex c8b2250..f834f0f 100644--- a/website/en/guide/multi-device.md+++ b/website/en/guide/multi-device.md@@ -15,7 +15,7 @@ iphone-control select auto # back to automatic choiceAgents use `iphone_list_devices` and `iphone_select_device`, which do the same.- Only devices connected over USB can be selected. It tries the UDID, then the device name, then a part of the name that matches exactly one device. If it matches several, you get an error and need the UDID.-- WDA takes 10–60 seconds to start after switching; check with `status` (or `iphone_status`) that it's ready. A device that has never had WDA needs [installing](#install-on-a-new-device) first.+- After switching, wait for the device to be ready: seconds with native control (iOS 27 and later), 10–60 seconds with WDA. Check with `status` (or `iphone_status`). A device on iOS 26 or earlier that has never had WDA needs [installing](#install-on-a-new-device) first.- The control page, `iphone-control viewer`, can switch too; see [Switching on the control page](#control-page).## Switching on the control page {#control-page}@@ -27,9 +27,10 @@ The device picker at the top of the `iphone-control viewer` page switches the co- **When the new device isn't ready**, the picture area says why:- Not connected: plug it in with a cable that carries data.- Not paired or Developer Mode off: run `iphone-control setup --reconfigure` in a terminal and pick Phone.+ - Preparing the phone (native control): mounting the disk image and connecting to the accessibility service, usually a few seconds to half a minute.- WDA starting: usually 10–60 seconds.- Not unlocked since a restart: unlock it by hand once; the first time UI automation is enabled after a restart, enter the passcode on the device.-- **A device without WDA:** with an Apple ID signed in, the picture area has a *Sign and install WDA* button. It takes about 1–2 minutes; keep the phone unlocked. Without an Apple ID, it tells you to run `iphone-control setup --reconfigure` and pick Apple ID.+- **A device without WDA** (iOS 26 and earlier): with an Apple ID signed in, the picture area has a *Sign and install WDA* button. It takes about 1–2 minutes; keep the phone unlocked. Without an Apple ID, it tells you to run `iphone-control setup --reconfigure` and pick Apple ID.- Only one device is controlled at a time; you can't watch two phones side by side.- Switching is refused while an AI task runs, and when `IPHONE_UDID` pins a device.diff --git a/website/en/guide/notifications.md b/website/en/guide/notifications.mdindex 90f450d..38360da 100644--- a/website/en/guide/notifications.md+++ b/website/en/guide/notifications.md@@ -2,6 +2,8 @@The daemon notifies you when the phone needs attention, through whichever channels are configured.+The notifications below about re-signing, the Apple ID, the signing certificate and WDA only come for devices on WDA; native control on iOS 27 and later has none of them.+## When| Event | What to do |diff --git a/website/en/guide/security.md b/website/en/guide/security.mdindex 91c5745..863285f 100644--- a/website/en/guide/security.md+++ b/website/en/guide/security.md@@ -6,13 +6,13 @@ This page has the essentials. What is stored, who can reach it and the details o## What is stored-- **The data directory** holds the Apple ID session, the signing key, pairing records and, with auto-unlock on, the passcode in **plain text**. Keep it and its backups as safe as a password. The Apple ID password is never stored.+- **The data directory** holds pairing records, with WDA also the Apple ID session and the signing key, and, with auto-unlock on, the passcode in **plain text**. Keep it and its backups as safe as a password. The Apple ID password is never stored.- **The control socket** is a Unix socket with mode 0600, and whoever can connect to it controls the phone: root on the host and the user the daemon runs as.- **Notification keys** are in the settings file `~/.config/iphone-control/env`, mode 0600.## Built-in protections-- **No network ports.** WDA is reached through usbmuxd. `wda-bridge` and the live `viewer` are explicit opt-ins that bind 127.0.0.1 by default (`viewer --lan` also opens to the local network, over HTTPS), and other web pages in your browser can't act through them. `wda-bridge` has no login: every local user can use it, so stop it when done. The `viewer` and the MCP on its port (`/mcp`) need the login token, from this machine too, since the viewer can't tell a local browser from a visit forwarded by frp, cloudflared or another reverse proxy. Tokens are kept in the data directory (0600); `viewer token` shows the owner's and `--new` replaces it, and named read-only tokens (`viewer token add <name> --read-only`) can watch but not act. An agent on another machine gets only its task's token: it acts for that task and can't pause or confirm it. `viewer --lan` opens the viewer to the local network, only to local-network addresses and over HTTPS there.+- **No network ports.** The daemon reaches the phone through usbmuxd. `wda-bridge` and the live `viewer` are explicit opt-ins that bind 127.0.0.1 by default (`viewer --lan` also opens to the local network, over HTTPS), and other web pages in your browser can't act through them. `wda-bridge` has no login: every local user can use it, so stop it when done. The `viewer` and the MCP on its port (`/mcp`) need the login token, from this machine too, since the viewer can't tell a local browser from a visit forwarded by frp, cloudflared or another reverse proxy. Tokens are kept in the data directory (0600); `viewer token` shows the owner's and `--new` replaces it, and named read-only tokens (`viewer token add <name> --read-only`) can watch but not act. An agent on another machine gets only its task's token: it acts for that task and can't pause or confirm it. `viewer --lan` opens the viewer to the local network, only to local-network addresses and over HTTPS there.- **No root.** The daemon runs as your regular user, as a per-user service; the install script refuses to run as root.- **Auto-unlock is off by default** and disables itself after one wrong attempt.- **Developer tools are off by default.**@@ -20,8 +20,8 @@ This page has the essentials. What is stored, who can reach it and the details o## Risks to know about-- **The anisette server.** Apple ID logins use a public third-party server by default (`mac-ani.jkcoxson.com`). It never gets your password, but it can see when you log in. To avoid it, run your own [anisette-v3-server](https://github.com/Dadoum/anisette-v3-server) and set `ICTL_ANISETTE_URL`.-- **Use a dedicated Apple ID.** A separate account contains the damage if the host is compromised.+- **The anisette server (WDA only).** Apple ID logins use a public third-party server by default (`mac-ani.jkcoxson.com`). It never gets your password, but it can see when you log in. To avoid it, run your own [anisette-v3-server](https://github.com/Dadoum/anisette-v3-server) and set `ICTL_ANISETTE_URL`.+- **Use a dedicated Apple ID (WDA only).** Native control on iOS 27 and later needs no Apple ID. A separate account contains the damage if the host is compromised.- **The agent acts with your hands.** It can send messages, buy things and change settings. The server tells agents to ask first for these, but that is an instruction, not enforcement.- **The developer tools add risk while they are on.** `iphone_web_eval` runs JavaScript in any inspectable page, Safari tabs included: it can read cookies and `localStorage` and send requests as the logged-in user. `iphone_install_app` accepts any path on the machine that runs the daemon. System logs and crash reports go into the agent's context and can contain private data. The `IPHONE_CONTROL_DEV_TOOLS` switch only decides whether the MCP server offers these tools; it is not a permission boundary. Turn it off when done.diff --git a/website/en/guide/tools.md b/website/en/guide/tools.mdindex 3b1f7df..c863000 100644--- a/website/en/guide/tools.md+++ b/website/en/guide/tools.md@@ -6,7 +6,7 @@ The MCP server provides 17 tools, 23 with the [developer tools](#developer-tools| Tool | What it does ||---|---|-| `iphone_status` | WDA ready or not, locked or not, foreground app, screen size |+| `iphone_status` | Ready or not, native or WDA, locked or not, foreground app, screen size || `iphone_screenshot` | Screenshot; with `x`, `y`, `width`, `height` it returns an enlarged region for small text and icons || `iphone_list_elements` | Elements with text: type, text, center, size; `filter` by text or type || `iphone_wait_for` | Wait until some text appears (page loaded, dialog shown); text inside input fields doesn't count. `timeout` defaults to 5 seconds, max 30 |@@ -35,7 +35,7 @@ Only one device is controlled at a time; every other tool acts on it. With one d| Tool | What it does ||---|---|| `iphone_list_devices` | Every iPhone/iPad on USB: name, model, iOS version, UDID; marks the one being controlled and whether it has an auto-unlock passcode |-| `iphone_select_device` | Switch to another device (UDID or name), remembered across restarts; `auto` goes back to automatic choice. WDA takes 10–60 s to start on the new device. Not possible when `IPHONE_UDID` is set |+| `iphone_select_device` | Switch to another device (UDID or name), remembered across restarts; `auto` goes back to automatic choice. The new device is ready in seconds with native control, 10–60 s with WDA. Not possible when `IPHONE_UDID` is set |Details: [Several devices](./multi-device).@@ -67,11 +67,19 @@ The tools under *Acting* accept `then`: it waits for the screen to settle and reThe result says how long it waited, whether the page is probably still loading, and whether a dialog is in the way. Even without `then`, it warns when a system alert covers the screen.+## Native control and WDA++iOS 27 and later are controlled natively by default. The tools and their results are the same, so agents needn't care, with a few differences:++- **Rows off the screen aren't listed:** scroll a long list to a row before finding or tapping it by text (WDA lists such rows but can't tap them).+- **Text is always pasted:** `iphone_type_text` puts the text on the phone's pasteboard and pastes it; the daemon taps *Allow Paste*, reads the field back and restores the pasteboard at once.+- **Coarser elements:** the accessibility service often makes one element of a whole row ("Wi-Fi, Derrors-5G"), so `iphone_list_elements` is shorter than with WDA; finding by contained text still works.+## When WDA is down: the HID fallback-When WDA can't be reached, screenshots, taps, swipes and buttons go through CoreDevice HID, with these limits:+For devices on WDA only. When WDA can't be reached, screenshots, taps, swipes and buttons go through CoreDevice HID, with these limits:-- It needs iOS 27 or later. Older iOS has no such path, and actions fail while WDA restarts.+- It needs iOS 27 or later (that is, a device with `ICTL_IOS_BACKEND=wda`). Older iOS has no such path, and actions fail while WDA restarts.- **Landscape:** before each touch the screen is captured again to check its orientation, and the daemon also needs a matching orientation from WDA in the last 30 seconds. Without one, for example right after a daemon restart, the touch is refused rather than guessed. Screenshots and buttons still work. Don't flip the device to the other side during an outage; wait for WDA to recover first.- **Screen size:** while WDA is down, taps and swipes return an error if there is no record of this device's size. Wait for WDA to come up once, or set [`SCREEN_W`/`SCREEN_H`](./configuration#advanced).- **No redo:** if a request already reached WDA and the connection then dropped or the response was incomplete, it doesn't fall back to HID, because the action may have happened and redoing it would tap or type twice. The tool returns an error; the agent should take a screenshot first.diff --git a/website/en/guide/what-is-iphone-control.md b/website/en/guide/what-is-iphone-control.mdindex 2205991..0c8f1b9 100644--- a/website/en/guide/what-is-iphone-control.md+++ b/website/en/guide/what-is-iphone-control.md@@ -4,6 +4,8 @@ iphone-control lets an AI agent such as Claude use a real iPhone or iPad that isIt works as a set of [MCP](https://modelcontextprotocol.io) (Model Context Protocol) tools, so any MCP client — Claude Code, Claude Desktop, Cursor and others — can use it directly.+The core is device control: a long-running daemon owns the phone and keeps serving with the browser's control page closed. The control page and remote access are optional; see [Viewer and Remote Use](./remote).+## What you can do with it- Let an agent get things done on the phone: look things up, fill in forms, change settings, play games.@@ -13,22 +15,23 @@ It works as a set of [MCP](https://modelcontextprotocol.io) (Model Context Proto## How it works-{.light-only}-{.dark-only}+{.light-only}+{.dark-only}-- A **daemon** runs all the time and owns the phone: it pairs, mounts the Developer Disk Image, opens a tunnel, and runs [WebDriverAgent](https://github.com/appium/WebDriverAgent) (WDA, an agent on top of Apple's XCTest automation) on the phone to read the screen, tap and type.+- A **daemon** runs all the time and owns the phone: it pairs, mounts the Developer Disk Image, opens a tunnel, and then drives the phone one of two ways, 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 CoreDevice HID, and apps launch through CoreDevice. Nothing is installed on the phone, no Apple ID is needed, and it's ready in seconds.+ - **iOS 17–26: WebDriverAgent.** [WebDriverAgent](https://github.com/appium/WebDriverAgent) (WDA, an agent on top of Apple's XCTest automation) runs on the phone to read the screen, tap and type. It is signed with your **free Apple ID**; free signatures expire after 7 days and the daemon re-signs before that. This route stays maintained.- The **MCP server** is started by the AI client on demand and simply forwards tool calls to the daemon.-- WDA is signed with your **free Apple ID**. Free signatures expire after 7 days; the daemon re-signs before that.-- While WDA is unavailable (for example while it restarts), taps, swipes, buttons and screenshots go through CoreDevice HID instead (iOS 27 and later).+- On iOS 27 and later set back to WDA (`ICTL_IOS_BACKEND=wda`), taps, swipes, buttons and screenshots go through CoreDevice HID while WDA is unavailable (for example while it restarts).## Compatibility| | ||---|---|| Host | Linux, x86_64 or arm64: one-command install, Homebrew or a .deb (Debian 12+, Ubuntu 22.04+), with the system usbmuxd; or build from source with Rust 1.89+<br>macOS, Apple Silicon: one-command install or Homebrew, or build from source, see [macOS](../deploy/macos)<br>No Windows |-| Phone | iPhone or iPad, iOS 17 or later; the HID fallback needs iOS 27 or later |-| Verified on | iPhone 15 Pro Max, iOS 27.0.1 (Linux, macOS)<br>iPhone 12 mini, iOS 26.4.1 (Linux)<br>iPad mini 5, iOS 26.6.1 (Linux) |-| Account | A free Apple ID; a dedicated one is recommended |+| Phone | iPhone or iPad, iOS 17 or later. **iOS 27 or later recommended** (native control); iOS 17–26 through WebDriverAgent |+| Verified on | iPhone 15 Pro Max, iOS 27.2.1, native control (Linux)<br>iPhone 15 Pro Max, iOS 27.0.1, WDA (Linux, macOS)<br>iPhone 12 mini, iOS 26.4.1 (Linux)<br>iPad mini 5, iOS 26.6.1 (Linux) |+| Account | None on iOS 27 and later (native control); on iOS 26 and earlier a free Apple ID, a dedicated one recommended |Other models and iOS versions should work but are untested — [reports](https://github.com/Derrors/iphone-control/issues) are welcome.@@ -40,16 +43,17 @@ The CLI, `doctor` output and MCP tool results are in Simplified Chinese by defau**Things you do on the phone**-- It does not bypass any iOS security: trusting the computer, enabling Developer Mode, trusting the developer certificate and enabling UI automation each need you on the phone once.-- After the phone reboots, the first unlock (BFU) always needs a person, who also enters the passcode once more to allow UI automation. iOS requires this.+- It does not bypass any iOS security: trusting the computer and enabling Developer Mode each need you on the phone once; with WDA, so do trusting the developer certificate and enabling UI automation.+- After the phone reboots, the first unlock (BFU) always needs a person; iOS requires this. With WDA, the passcode is also entered once more to allow UI automation.**Usage**- A host can have several iPhones and iPads connected, but controls one at a time; see [Several devices](./multi-device). Don't run two copies of iphone-control, or other usbmuxd-based tools, against the same device.- Games, maps and video have no element tree; agents work from screenshots and coordinates there.-- The HID fallback needs iOS 27 or later. On older iOS everything goes through WebDriverAgent, and actions fail while it restarts.-- Free Apple ID profiles last 7 days. Re-signing is automatic, but an expired Apple ID session needs `login`.-- Apple ID logins use a public third-party anisette server by default; set `ICTL_ANISETTE_URL` to use your own, see [Configuration](./configuration).+- Native control (iOS 27 and later): rows off the screen aren't listed, so a long list has to be scrolled to them first; text is always pasted, and the daemon taps *Allow Paste* itself and puts the pasteboard back afterwards.+- On iOS 26 and earlier everything goes through WebDriverAgent, with no HID fallback, and actions fail while it restarts.+- With WDA: free Apple ID profiles last 7 days. Re-signing is automatic, but an expired Apple ID session needs `login`.+- With WDA, Apple ID logins use a public third-party anisette server by default; set `ICTL_ANISETTE_URL` to use your own, see [Configuration](./configuration).**macOS**diff --git a/website/en/index.md b/website/en/index.mdindex 6b5d67f..84325b6 100644--- a/website/en/index.md+++ b/website/en/index.md@@ -4,7 +4,7 @@ layout: homehero:name: iphone-controltext: Let AI agents use a real iPhone- tagline: Control an iPhone or iPad over USB from Linux or a Mac and hand it to Claude and other AI as MCP tools. No Xcode, no paid developer account.+ tagline: Control an iPhone or iPad over USB from Linux or a Mac, reliably and fast, and hand it to Claude and other AI as MCP tools. No Xcode, no paid developer account; on iOS 27 and later, recommended, no Apple ID either.image:src: /logo.svgalt: iphone-control@@ -22,26 +22,26 @@ hero:features:- icon: 🤖title: Tools for agents- details: Screenshots, on-screen elements, tap by text, swipe, typing (Chinese too), apps, waiting for pages, multi-step batches — 17 MCP tools- - icon: 💻- title: Linux or Mac- details: No Mac needed on Linux, no Xcode needed on a Mac. WebDriverAgent is signed with a free Apple ID and re-signed before the 7-day profile expires+ details: Screenshots, on-screen elements, tap by text, swipe, typing (Chinese too), apps, waiting for pages, multi-step batches — 17 MCP tools; actions can return the settled screen+ - icon: ⚡+ title: Native on iOS 27+ details: iOS 27 and later are controlled natively by default — nothing installed on the phone, no Apple ID, no signing, ready in seconds. Recommended+ - icon: 📱+ title: iOS 17–26 too+ details: Controlled through WebDriverAgent, signed with a free Apple ID and re-signed before the 7-day profile expires. This route stays maintained- icon: 🔁title: Keeps itself running- details: Pairs, mounts the Developer Disk Image, starts WDA, and recovers after unplugging, reboots and crashes- - icon: 🛟- title: Fallback path- details: When WDA is down, taps, swipes, buttons and screenshots still work through CoreDevice HID (iOS 27+)+ details: A long-running daemon owns the phone and recovers after unplugging, reboots and lost connections; it serves with the control page closed+ - icon: 🙋+ title: A person stays in charge+ details: AI tasks can be paused, taken over or stopped at any time; paying, deleting or sending waits for your OK, and an agent can't approve its own task+ - icon: 🖥️+ title: Optional control page+ details: Watch the live screen in a browser, act on it and hand out tasks; open it to the local network and agents elsewhere connect over HTTP MCP. No ports open by default- icon: 🔔title: Tells you when it needs you- details: Bark or Telegram notifications for failed re-signing, expired sessions, reboots that need the passcode, or going offline- - icon: 🔒- title: No open ports- details: WDA is reached through usbmuxd; nothing listens on the network. Auto-unlock is off by default+ details: Bark or Telegram notifications when the phone goes offline, needs its passcode after a reboot, or re-signing fails- icon: 📦title: One binarydetails: Written in Rust. Install with one command, Homebrew or a .deb, then run iphone-control and it walks you through setup; or build from source- - icon: 🧭- title: Fewer round trips- details: Actions can return the resulting screen after waiting for it to settle, and flag loading pages and blocking alerts---diff --git a/website/en/troubleshoot/faq.md b/website/en/troubleshoot/faq.mdindex f0a9775..bde567f 100644--- a/website/en/troubleshoot/faq.md+++ b/website/en/troubleshoot/faq.md@@ -17,6 +17,8 @@ Messages are in Simplified Chinese by default, and in English with `IPHONE_CONTR| 未配对<br>Not paired | No pairing record | Run `setup --reconfigure`, pick *Phone*, and tap *Trust* on the phone || 开发者模式未打开<br>Developer Mode is off | Developer Mode is off | *Settings → Privacy & Security → Developer Mode*. The toggle only appears after the phone has been seen by a developer tool; running `setup --reconfigure` and picking *Phone* takes care of that || 手机锁屏,隧道建不起来<br>The phone is locked, the tunnel can't be opened | Not unlocked since the last reboot | Unlock it once by hand; the state stays until then and the daemon keeps retrying |+| 正在准备手机(挂载开发者镜像、连接无障碍服务)<br>Preparing the phone (mounting the developer disk image, connecting to the accessibility service) | Native control (iOS 27 and later) getting ready | Wait, usually a few seconds to half a minute; keep the phone unlocked |+| 准备手机失败,稍后重试:…<br>Preparing the phone failed, retrying later: … | Native control isn't ready | Read the error after the colon and run `doctor`; see [Native control doesn't get ready](#native-control) || WDA 还没签名安装<br>WDA not signed and installed yet | WDA not installed | Run `sign` or `setup` || 正在启动 WDA<br>Starting WDA | Starting WDA (up to about 2 minutes) | Wait. On iOS 27 and later, taps, swipes and screenshots already work through the HID fallback, but a landscape touch needs an orientation from WDA in the last 30 seconds or it is refused, and an unknown screen size returns an error; see [Tools](../guide/tools#when-wda-is-down-the-hid-fallback). On older iOS, wait for WDA || WDA 卡在手机上的「Enable UI Automation」密码框<br>WDA is stuck at the “Enable UI Automation” passcode prompt | The phone asks for the passcode for "XCTest" | Enter the passcode on the phone. This happens after a reboot, and sometimes after the daemon is restarted several times in a row. The daemon retries every 60 seconds and notifies you once |@@ -33,8 +35,18 @@ Messages are in Simplified Chinese by default, and in English with `IPHONE_CONTR- **Drops about once a minute while charging:** with *Settings → Battery → Charging → 80% Limit* on, the phone keeps starting and stopping charging near 80%, and each switch renegotiates USB-C power, which drops USB for 3–5 seconds. Set the limit to 100% on a phone used for automation.- **On a Mac:** usbmuxd is part of macOS; if `doctor` can't reach it, run `sudo launchctl kickstart -k system/com.apple.usbmuxd`. See [macOS](../deploy/macos).+## Native control doesn't get ready {#native-control}++iOS 27 and later are controlled natively by default, which needs only pairing, Developer Mode, the developer disk image and the accessibility service. When `status` keeps saying *Preparing the phone failed*:++- **The disk image doesn't download:** it comes from GitHub; set a proxy if needed (`iphone-control setup --reconfigure`, pick *Proxy*).+- **The phone is locked:** keep it unlocked while it gets ready.+- **Still stuck:** run `doctor` to see which layer fails and [open an issue](https://github.com/Derrors/iphone-control/issues/new/choose). Meanwhile you can go back to WDA with `ICTL_IOS_BACKEND=wda` in `~/.config/iphone-control/env` and `iphone-control service restart` (needs an Apple ID; see the next section).+## WDA won't start+For devices on WDA only: iOS 26 and earlier, or with `ICTL_IOS_BACKEND=wda`.+- **"Untrusted developer":** after the first install, trust your Apple ID under *Settings → General → VPN & Device Management* (the phone needs internet).- <a id="cert"></a>**Signing certificate revoked:** `status` says `unexpected response` although the profile is still valid; tapping the WebDriverAgentRunner icon on the device says the app can't be verified.- Why: every install (each machine, each data directory) has its own signing key and certificate, and a free Apple ID holds at most two certificates at a time. Signing somewhere new for the first time (another machine, moving from Docker to a native install, a deleted data directory) or with the same Apple ID in a sideloading tool such as AltStore or SideStore creates a certificate; when the team is full an old one is revoked, and apps signed with it won't start on any device.diff --git a/website/guide/auto-unlock.md b/website/guide/auto-unlock.mdindex f8d43f8..637f81c 100644--- a/website/guide/auto-unlock.md+++ b/website/guide/auto-unlock.md@@ -1,6 +1,6 @@# 自动解锁-默认关闭。开启后,手机锁屏时,MCP 操作前会先用你保存的锁屏密码解锁手机。截图、读元素、`iphone_wait_for` 这些只读工具也一样。WDA 不可用时不会自动解锁。+默认关闭。开启后,手机锁屏时,MCP 操作前会先用你保存的锁屏密码解锁手机。截图、读元素、`iphone_wait_for` 这些只读工具也一样。原生控制(iOS 27 及以上)和 WDA 用同一套规则;用 WDA 的设备在 WDA 不可用时不会自动解锁。::: danger 先想清楚风险密码以**明文**存在数据目录里。能登录这台主机、能读数据目录备份、或能调用这个 MCP 的人,都能解锁你的手机。只在你完全掌控的主机上开启,最好用一部专门用来自动化的手机。diff --git a/website/guide/cli.md b/website/guide/cli.mdindex c19e2d8..b1eb247 100644--- a/website/guide/cli.md+++ b/website/guide/cli.md@@ -85,10 +85,10 @@ Viewer 要用令牌登录(见下面的 `viewer`)。持有令牌的人(只| 命令 | 作用 ||---|---|-| `setup` | 把引导完整走一遍:语言、代理、后台服务、配对、开发者模式、Apple ID、签名安装 WDA、自动解锁、通知、注册 MCP。做过的步骤跳过。手机部分只作用于正在控制的那台 |+| `setup` | 把引导完整走一遍:语言、代理、后台服务、配对、开发者模式、Apple ID、签名安装 WDA、自动解锁、通知、注册 MCP。做过的步骤跳过;iOS 27 及以上(原生控制)跳过 Apple ID 和签名安装 WDA。手机部分只作用于正在控制的那台 || `setup --reconfigure` | 重新设置其中一项,从菜单里选:全部重新走一遍、语言、代理、后台服务、Apple ID(重新登录并重签 WDA)、手机(配对、开发者模式、安装 WDA)、自动解锁密码、通知、注册 MCP(Claude Code、Codex) |-| `login [邮箱]` | 登录 Apple ID。密码和验证码只在这里输入;不给邮箱就交互输入 |-| `sign` | 立即签名并安装 WDA,同 `resign --force`。会把设备注册到 Apple ID |+| `login [邮箱]` | 登录 Apple ID(只有用 WDA 的设备需要)。密码和验证码只在这里输入;不给邮箱就交互输入 |+| `sign` | 立即签名并安装 WDA(只有用 WDA 的设备需要),同 `resign --force`。会把设备注册到 Apple ID || `resign [--force]` | 描述文件剩余不到 `RESIGN_MIN_DAYS` 天才重签;`--force` 立即重签。不带 `--force` 时不会替没装过 WDA 的设备注册 |设置菜单中用 ↑/↓ 移动、Enter 确认,也可以输入编号再回车;确认提示支持 ←/→ 选择。Esc 取消并退出向导。Ctrl+C 中断向导,退出码为 130。两者都会保留已保存的步骤。菜单始终用 `>` 标记选中项,不依赖颜色。窗口缩放后按键会按新宽度重绘。@@ -129,7 +129,7 @@ Viewer 要用令牌登录(见下面的 `viewer`)。持有令牌的人(只| 命令 | 作用 ||---|---|| `notify-test [事件]` | 发测试通知:每类事件各一条,或只发一类(`resign`、`session`、`pin`、`pin-recovered`、`unlock`、`offline`、`online`) |-| `wda-bridge [--port <端口>]` | 把 WDA 桥接到 `127.0.0.1`,端口默认 8100,给别的工具用。WDA 没有认证,本机任何用户都能连上,用完就停 |+| `wda-bridge [--port <端口>]` | 把 WDA 桥接到 `127.0.0.1`(只有用 WDA 的设备),端口默认 8100,给别的工具用。WDA 没有认证,本机任何用户都能连上,用完就停 || `viewer [--port <端口>] [--lan] [--lan-host <名字>…] [--tls auto\|on\|off] [--tls-cert <PEM> --tls-key <PEM>] [--mcp on\|off]` | 浏览器里的控制台,**要先登录**:所有经 HTTP 的访问(本机也一样,经 frp 等反向代理转发进来的访问看起来就是本机)都要令牌,`viewer token` 显示令牌和点开就能登录的链接;浏览器登录一次后记住 30 天,程序和 MCP 客户端用 `Authorization: Bearer <令牌>`。同一个端口的 `/mcp` 还提供 MCP over HTTP(见[接入 AI 客户端](./mcp-clients#通过-url-接入-http),`--mcp off` 关掉),地址 `http://127.0.0.1:8200/`(默认端口);加 `--lan` 时局域网里也能用 `https://<这台机器的 IP>:8200/` 打开(同一个端口;局域网来的 `http://` 会跳到 `https://`)。证书默认是本机生成的自签证书(存在数据目录的 `viewer-tls/`,一直沿用),浏览器第一次打开会提示不受信任:核对启动时或 `service status` 显示的 SHA-256 指纹一致后继续。用 `--tls-cert`/`--tls-key` 换成自己的证书(mkcert、`tailscale cert` 等)就没有这个提示。`--tls off` 时局域网里是 HTTP,画面退回 MJPEG(浏览器只在 localhost 或 HTTPS 上提供 WebCodecs)。页面有中英文两种(默认跟着 `IPHONE_CONTROL_LANG`,页面上可切换)。**画面:** 实时画面像触摸屏一样用:点一下是点击,拖动是滑动,按住是长按,滚动鼠标滚轮或触控板也能滚动页面,另有输入框和硬件键。iOS 27 起手指跟着鼠标实时移动(经 CoreDevice HID,最后一次触摸后 30 秒内手机保持亮屏);更低的版本在松开后发整段手势。操作都和 MCP 调用一样经守护进程,和 agent 的操作排队,并先自动解锁。iOS 27 及以上画面直接用手机自己的视频;其余来自 WDA(WDA 没就绪时没有画面),是 H.264 或 MJPEG,见下面的[画面编码](#viewer-picture)。画面与设备实测的尺寸、方向一致时可以点按。转屏或换机后,请在新画面上重新操作。侧栏底部的「设置」可调整主题和字号,画面缩放用画面上方的加减号调整(双指捏合不缩放,免得拖动时误触)。**设备面板:** 状态和就绪检查、已安装的 App、屏幕上的元素。页面跟着守护进程控制的设备走,在页面上或别处切换设备,画面和面板都会跟过去,见[多台设备](./multi-device#control-page)。**AI 任务:** 写下任务,交给本机的 agent 执行(PATH 里有的 Claude Code 或 Codex,在页面上选)。开任务前可以用 Agent 旁边的 App 按钮限定范围,到了别的 App 每一步都先等你确认。可以暂停、接管后交还、停止;付款、删除、发消息之前它会在页面上请你确认。令牌就是钥匙,别外传。详见[控制台与远程使用](./remote) || `viewer token [--new]` | 显示控制台的 `owner` 登录令牌、本机和局域网的登录链接,以及接入 HTTP MCP 的命令;`--new` 换一个新的,用旧令牌登录的浏览器和 MCP 客户端都要用新的。令牌存在数据目录的 `viewer-tokens.json`(0600),改动马上生效,不用重启控制台 || `viewer token add <名字> [--read-only]`、`list`、`show <名字> [--new]`、`remove <名字>` | 有名字的令牌,比如每人一个、每台设备一个;控制台的任务记录里记下是哪个令牌暂停、接管、确认的。`--read-only` 的令牌只能看画面、设备状态和任务,所有操作都被拒绝,页面上也不显示操作入口。`list` 不显示令牌本身;最后一个能操作的令牌不能删 |@@ -156,5 +156,5 @@ macOS 上,以及 Linux 上装了 ffmpeg 时,控制台的画面是 H.264,- **链路慢时:** 页面每 100 毫秒告诉 viewer 收到了多少。链路跟不上时少编几帧,画面帧率下降,但不会越来越滞后。比如每秒 200 KB 的链路,滚动停下后约 0.6 秒画面追上。- **自动改用 MJPEG:** Linux 上没有 ffmpeg、没有能用的编码器、浏览器不支持 WebCodecs(较旧的浏览器)时自动改用 MJPEG;画面静止时不再重复发同一张图,链路慢时只发最新的一张。- **弱网模式:** 控制台「设置」里的开关,适合外网或信号差时用。画面流量减少约一半,帧率不变;画面静止时看不出区别,动起来时边缘会有些糊块,停下约半秒后恢复。手机自己的视频(HEVC)每台手机只有一路,码率上限在开始时和手机协商,所以开着时所有在看这台手机的页面都会一起降(约 6 Mbit/s 上限降到 2 Mbit/s),第一个开它和最后一个关它的页面会让所有人的画面断开半秒左右再接上,进行中的触摸也会中断。H.264 只影响开它的那个页面(qp 提到 26)。开着时画面下方会写「弱网模式」。-- **看现在用的是哪种:** 画面下方写着,例如「实时画面 · WDA · HEVC iPhone 312 KB/s」(手机自己的视频)或「实时画面 · WDA · H.264 VAAPI 254 KB/s」。+- **看现在用的是哪种:** 画面下方写着,例如「实时画面 · 原生 · HEVC iPhone 312 KB/s」(原生控制,手机自己的视频)、「实时画面 · WDA · HEVC iPhone 312 KB/s」或「实时画面 · WDA · H.264 VAAPI 254 KB/s」。- **设置:** `IPHONE_CONTROL_VIEWER_CODEC`(`device` 只用手机自己的视频,`mjpeg` 只用 MJPEG)、`IPHONE_CONTROL_VIEWER_QP`、`ICTL_FFMPEG`,见[配置](./configuration)。Linux 上安装 ffmpeg:`sudo apt install ffmpeg`,deb 包会推荐安装它;macOS 上不用装。diff --git a/website/guide/getting-started.md b/website/guide/getting-started.mdindex 7fd7c1c..9a4b4a8 100644--- a/website/guide/getting-started.md+++ b/website/guide/getting-started.md@@ -5,8 +5,8 @@## 准备- 一台主机:Mac(Apple 芯片),或 Linux(x86_64、aarch64)-- iPhone 或 iPad(iOS 17+)和能传数据的线-- 一个免费 Apple ID(建议专门注册一个)+- iPhone 或 iPad 和能传数据的线。**推荐 iOS 27 及以上**:原生控制,手机上什么都不装,不用 Apple ID;iOS 17–26 也能用,经 WebDriverAgent+- iOS 26 及以下还要一个免费 Apple ID(建议专门注册一个),用来给 WebDriverAgent 签名- 主机能访问苹果服务器和 GitHub;国内网络一般要配代理(引导里会问)::: warning 一部手机只接一份@@ -77,6 +77,8 @@ iphone-control第一次运行时,它会在终端里一步步带你完成设置。已经做好的步骤会跳过;中途退出了,再运行 `iphone-control` 会接着做。它要在终端里交互运行。+iOS 27 及以上的手机走原生控制,引导会跳过登录 Apple ID 和签名安装 WDA,下表标了「iOS 26 及以下」的步骤都不用做。+| 步骤 | 你要做的 ||---|---|| 语言 | 选中文或 English |@@ -85,9 +87,10 @@ iphone-control| 等待手机连接 | 解锁手机 || 配对 | 手机上弹出「要信任此电脑吗?」时点「信任」,输入锁屏密码 || 开发者模式 | 手机上:设置 → 隐私与安全性 → 开发者模式 → 打开 → 重新启动;重启解锁后在弹窗里点「打开」 |-| 登录 Apple ID | 在终端里输入 Apple ID、密码和双重认证验证码 |-| 签名安装 WDA | 保持手机解锁 |-| 等待 WDA 启动 | 手机上:设置 → 通用 → VPN 与设备管理 → 信任你的 Apple ID(要联网);如果弹出「为 XCTest 输入 iPhone 密码」,输入锁屏密码 |+| 登录 Apple ID(iOS 26 及以下) | 在终端里输入 Apple ID、密码和双重认证验证码 |+| 签名安装 WDA(iOS 26 及以下) | 保持手机解锁 |+| 等待手机准备好(iOS 27 及以上) | 保持手机解锁,通常几秒到半分钟 |+| 等待 WDA 启动(iOS 26 及以下) | 手机上:设置 → 通用 → VPN 与设备管理 → 信任你的 Apple ID(要联网);如果弹出「为 XCTest 输入 iPhone 密码」,输入锁屏密码 || 自动解锁(可选) | 要的话输入锁屏密码,见[自动解锁](./auto-unlock) || 通知(可选) | 选 Bark 或 Telegram,填 key 或 token,会发一条测试通知,见[通知](./notifications) || 注册 MCP | 找到 Claude Code 或 Codex 时,回车注册到它 |@@ -120,7 +123,7 @@ iphone-control viewer token # 另开一个终端:点开它打印的链接## 检查状态```bash-iphone-control status # 当前状态、描述文件还剩多久、最近日志+iphone-control status # 当前状态、控制方式(原生或 WDA)、最近日志iphone-control doctor # 逐层诊断,每项失败都给出修复办法```@@ -135,4 +138,4 @@ iphone-control doctor # 逐层诊断,每项失败都给出修复办法| Homebrew | `brew services stop iphone-control`,再 `brew uninstall iphone-control` || deb 包 | `systemctl --user disable --now iphone-control`,再 `sudo apt remove iphone-control` |-数据目录 `~/.local/share/iphone-control`(Apple ID 会话、签名、自动解锁密码)会留着,不需要的话自己删除;手机上的 WebDriverAgent 在手机上删除。+数据目录 `~/.local/share/iphone-control`(Apple ID 会话、签名、自动解锁密码)会留着,不需要的话自己删除;用过 WDA 的话,手机上的 WebDriverAgent 在手机上删除。diff --git a/website/guide/multi-device.md b/website/guide/multi-device.mdindex 1e2d0d8..7215cdf 100644--- a/website/guide/multi-device.md+++ b/website/guide/multi-device.md@@ -15,7 +15,7 @@ iphone-control select auto # 改回自动选agent 用 `iphone_list_devices` 和 `iphone_select_device`,效果一样。- 只能选 USB 上接着的设备。先比 UDID,再比设备名;设备名包含这段文字且只有一台时也行,对上多台就报错,要用 UDID 指定。-- 切换后 WDA 要 10~60 秒才起来,先用 `status`(或 `iphone_status`)确认就绪。没装过 WDA 的设备要先[安装](#给新设备安装)。+- 切换后要等新设备就绪:原生控制(iOS 27 及以上)几秒,WDA 要 10~60 秒。先用 `status`(或 `iphone_status`)确认。iOS 26 及以下没装过 WDA 的设备要先[安装](#给新设备安装)。- 浏览器控制台 `iphone-control viewer` 也能切换,见[在控制台里切换](#control-page)。## 在控制台里切换 {#control-page}@@ -27,9 +27,10 @@ agent 用 `iphone_list_devices` 和 `iphone_select_device`,效果一样。- **新设备没就绪时**,画面区域会说明原因:- 没有连上设备:用数据线连上,确认数据线能传数据。- 还没配对或没开开发者模式:在终端运行 `iphone-control setup --reconfigure`,选「手机」。+ - 正在准备手机(原生控制):挂载开发者镜像、连接无障碍服务,通常几秒到半分钟。- 正在启动 WDA:通常 10~60 秒。- 设备重启后还没解锁过:在设备上手动解锁一次;首次启用 UI 自动化时在设备上输入锁屏密码。-- **没装 WDA 的设备**:已登录 Apple ID 时,画面区域有「签名并安装 WDA」按钮,大约 1~2 分钟,期间保持手机解锁。没登录时,它会提示在终端运行 `iphone-control setup --reconfigure`,选「Apple ID」。+- **没装 WDA 的设备**(iOS 26 及以下):已登录 Apple ID 时,画面区域有「签名并安装 WDA」按钮,大约 1~2 分钟,期间保持手机解锁。没登录时,它会提示在终端运行 `iphone-control setup --reconfigure`,选「Apple ID」。- 同一时间只控制一台,不能并排看两部手机。- AI 任务执行中不能切换;设了 `IPHONE_UDID` 时也不能切换。diff --git a/website/guide/notifications.md b/website/guide/notifications.mdindex 0933085..861a941 100644--- a/website/guide/notifications.md+++ b/website/guide/notifications.md@@ -2,6 +2,8 @@手机需要你处理时,守护进程会推送通知。配了哪个渠道就发哪个,都不配就不发。+下表里和重签、Apple ID、签名证书、WDA 有关的通知只出现在用 WDA 的设备上;iOS 27 及以上的原生控制不会有。+## 什么时候通知| 事件 | 你要做的 |diff --git a/website/guide/security.md b/website/guide/security.mdindex 5238e16..0650a15 100644--- a/website/guide/security.md+++ b/website/guide/security.md@@ -6,13 +6,13 @@ iphone-control 本质上是一个手机遥控器:能访问它的人,就能## 存了什么-- **数据目录**里有 Apple ID 会话、开发签名私钥、配对记录,开启自动解锁时还有**明文**的锁屏密码,要像密码一样保管和备份。Apple ID 密码本身不保存。+- **数据目录**里有配对记录,用 WDA 时还有 Apple ID 会话、开发签名私钥,开启自动解锁时还有**明文**的锁屏密码,要像密码一样保管和备份。Apple ID 密码本身不保存。- **控制接口**是权限 0600 的 Unix socket,能连上它就能操控手机:主机 root 和运行守护进程的那个用户。- **通知密钥**在设置文件 `~/.config/iphone-control/env` 里,权限 0600。## 默认的保护-- **不开网络端口。** WDA 经 usbmuxd 直连手机。`wda-bridge` 和实时画面 `viewer` 都要显式开启,默认只绑 127.0.0.1(`viewer --lan` 也对局域网开放,走 HTTPS),浏览器里的其他网页借不了它们操作手机。`wda-bridge` 没有登录,本机任何用户都能用,用完就停。`viewer` 和它同一个端口上的 MCP(`/mcp`)要令牌登录,本机也一样:控制台分不清本机的浏览器和经 frp、cloudflared 等反向代理转发进来的访问。令牌存在数据目录(0600),`viewer token` 显示、`--new` 换掉;可以加有名字的只读令牌(`viewer token add <名字> --read-only`),只能看不能操作。另一台机器上的 agent 只拿任务口令,只能为它的任务操作手机,不能暂停或确认自己的任务。`viewer --lan` 会把控制台开放给局域网,只接受局域网地址来的连接,局域网里走 HTTPS。+- **不开网络端口。** 守护进程经 usbmuxd 直连手机。`wda-bridge` 和实时画面 `viewer` 都要显式开启,默认只绑 127.0.0.1(`viewer --lan` 也对局域网开放,走 HTTPS),浏览器里的其他网页借不了它们操作手机。`wda-bridge` 没有登录,本机任何用户都能用,用完就停。`viewer` 和它同一个端口上的 MCP(`/mcp`)要令牌登录,本机也一样:控制台分不清本机的浏览器和经 frp、cloudflared 等反向代理转发进来的访问。令牌存在数据目录(0600),`viewer token` 显示、`--new` 换掉;可以加有名字的只读令牌(`viewer token add <名字> --read-only`),只能看不能操作。另一台机器上的 agent 只拿任务口令,只能为它的任务操作手机,不能暂停或确认自己的任务。`viewer --lan` 会把控制台开放给局域网,只接受局域网地址来的连接,局域网里走 HTTPS。- **不用 root。** 守护进程以你的普通用户身份作为用户服务运行,安装脚本拒绝以 root 运行。- **自动解锁默认关闭**,输错一次即停用。- **开发者工具默认关闭**。@@ -20,8 +20,8 @@ iphone-control 本质上是一个手机遥控器:能访问它的人,就能## 需要知道的风险-- **anisette 服务。** 登录 Apple ID 默认用公共的第三方服务(`mac-ani.jkcoxson.com`)。它拿不到你的密码,但能看到你什么时候登录。介意的话自建 [anisette-v3-server](https://github.com/Dadoum/anisette-v3-server),设 `ICTL_ANISETTE_URL`。-- **用专门的 Apple ID。** 主机被入侵时,专门的账号能把影响限制住。+- **anisette 服务(只有用 WDA 时)。** 登录 Apple ID 默认用公共的第三方服务(`mac-ani.jkcoxson.com`)。它拿不到你的密码,但能看到你什么时候登录。介意的话自建 [anisette-v3-server](https://github.com/Dadoum/anisette-v3-server),设 `ICTL_ANISETTE_URL`。+- **用专门的 Apple ID(只有用 WDA 时)。** iOS 27 及以上的原生控制不用 Apple ID。主机被入侵时,专门的账号能把影响限制住。- **agent 用你的手在操作。** 它能发消息、付款、改设置。服务端会要求 agent 在这类操作前先问你,但这只是指示,不是强制。- **开发者工具开着时风险更大。** `iphone_web_eval` 能在任意可检查的页面(含 Safari 标签页)执行 JavaScript,读 cookie 和 localStorage,以已登录身份发请求;`iphone_install_app` 接受运行守护进程的机器上的任意路径;系统日志和崩溃报告会进入 agent 的上下文,可能含隐私。开关 `IPHONE_CONTROL_DEV_TOOLS` 只决定 MCP 提不提供这些工具,不是权限边界。用完就关。diff --git a/website/guide/tools.md b/website/guide/tools.mdindex 6abfd91..08bf887 100644--- a/website/guide/tools.md+++ b/website/guide/tools.md@@ -6,7 +6,7 @@ MCP 服务提供 17 个工具,开启[开发者工具](#开发者工具-显式| 工具 | 作用 ||---|---|-| `iphone_status` | WDA 是否就绪、是否锁屏、前台 App、屏幕尺寸 |+| `iphone_status` | 是否就绪、控制方式(原生或 WDA)、是否锁屏、前台 App、屏幕尺寸 || `iphone_screenshot` | 截图;给出 `x`、`y`、`width`、`height` 时只返回这块区域的放大图,看清小字和小图标 || `iphone_list_elements` | 列出屏幕上带文字的元素:类型、文字、中心点、尺寸;`filter` 可按文字或类型筛选 || `iphone_wait_for` | 等某段文字出现(页面加载完、弹窗出现),出现就返回;输入框里的字不算。`timeout` 默认 5 秒,最多 30 秒 |@@ -35,7 +35,7 @@ MCP 服务提供 17 个工具,开启[开发者工具](#开发者工具-显式| 工具 | 作用 ||---|---|| `iphone_list_devices` | 列出 USB 上接着的 iPhone/iPad:名字、型号、iOS 版本、UDID,标出正在控制哪台、有没有设自动解锁密码 |-| `iphone_select_device` | 改为控制另一台(UDID 或设备名),重启后还记得;`auto` 改回自动选。新设备上的 WDA 起来要 10~60 秒。设了 `IPHONE_UDID` 时不能切换 |+| `iphone_select_device` | 改为控制另一台(UDID 或设备名),重启后还记得;`auto` 改回自动选。切过去后,原生控制几秒就绪,WDA 要 10~60 秒。设了 `IPHONE_UDID` 时不能切换 |详见[多台设备](./multi-device)。@@ -67,11 +67,19 @@ MCP 服务提供 17 个工具,开启[开发者工具](#开发者工具-显式结果里会说明等了多久、页面是否可能还在加载、有没有弹窗挡着。不带 `then` 时,如果有系统弹窗挡着也会提醒。+## 原生控制和 WDA 的差别++iOS 27 及以上默认原生控制,工具和返回格式不变,agent 不用区分。有几处差别:++- **屏幕外的行读不到**:长列表要先滑到,才能按文字找到、点到(WDA 会列出但点不到)。+- **输入一律粘贴**:`iphone_type_text` 把文字写进手机剪贴板再粘贴,守护进程自动点「允许粘贴」,读回输入框核对后马上还原剪贴板。+- **元素粒度**:无障碍服务常把一行合成一个元素(「Wi-Fi、Derrors-5G」),`iphone_list_elements` 的输出比 WDA 短;按包含的文字照样找得到。+## WDA 不可用时:HID 后备-连不上 WDA 时,截图、点击、滑动、按键改走 CoreDevice HID。有这些限制:+只对用 WDA 的设备。连不上 WDA 时,截图、点击、滑动、按键改走 CoreDevice HID。有这些限制:-- 要 iOS 27 及以上。更早的 iOS 没有这条路线,WDA 重启期间操作会失败。+- 要 iOS 27 及以上(也就是设了 `ICTL_IOS_BACKEND=wda` 的设备)。更早的 iOS 没有这条路线,WDA 重启期间操作会失败。- **横屏**:每次触摸前都重新截图核对方向,还要 30 秒内从 WDA 拿到过方向并且和当前一致,否则拒绝触摸,不会猜(守护进程刚重启后就是这样)。截图和按键不受影响。WDA 掉线期间不要把设备翻到另一侧,等它恢复再翻。- **屏幕尺寸**:WDA 不可用、又没有这台设备的尺寸记录时,点击和滑动报错。等 WDA 起来一次,或设 [`SCREEN_W`/`SCREEN_H`](./configuration#高级)。- **不会重做**:请求已经发给 WDA、连接才断开或响应不完整时,不退到 HID,因为动作可能已经做了,重做会点两次、输两遍。工具会报错,agent 要先截图确认再决定。diff --git a/website/guide/what-is-iphone-control.md b/website/guide/what-is-iphone-control.mdindex 7a8ea39..b72d3e0 100644--- a/website/guide/what-is-iphone-control.md+++ b/website/guide/what-is-iphone-control.md@@ -4,6 +4,8 @@ iphone-control 让 AI agent(例如 Claude)操作一台用数据线接在 Lin它以 [MCP](https://modelcontextprotocol.io)(Model Context Protocol)工具的形式提供能力,支持 MCP 的客户端(Claude Code、Claude Desktop、Cursor 等)都能直接用。+核心是设备控制:一个常驻守护进程独占手机,不开浏览器的控制台也一直提供服务。控制台和远程接入都是可选的,见[控制台与远程使用](./remote)。+## 能用来做什么- 让 agent 在手机上完成任务:查信息、填表、改设置、玩游戏。@@ -13,22 +15,23 @@ iphone-control 让 AI agent(例如 Claude)操作一台用数据线接在 Lin## 怎么工作-{.light-only}-{.dark-only}+{.light-only}+{.dark-only}-- **守护进程**常驻,独占手机:配对、挂载开发者镜像、建立隧道,在手机上运行 [WebDriverAgent](https://github.com/appium/WebDriverAgent)(WDA,苹果 XCTest 自动化框架上的代理),用它读界面、点击和输入。+- **守护进程**常驻,独占手机:配对、挂载开发者镜像、建立隧道,然后按 iOS 版本选一条路线操作手机:+ - **iOS 27 及以上:原生控制(默认)。** 读界面用系统的无障碍服务,点击、滑动、按键走 CoreDevice HID,启动 App 走 CoreDevice。手机上什么都不装,不用 Apple ID,几秒就绪。+ - **iOS 17–26:WebDriverAgent。** 在手机上运行 [WebDriverAgent](https://github.com/appium/WebDriverAgent)(WDA,苹果 XCTest 自动化框架上的代理),用它读界面、点击和输入。WDA 用你的**免费 Apple ID** 签名,免费签名 7 天过期,守护进程会在到期前自动重签。这条路线继续维护。- **MCP 服务**由 AI 客户端按需拉起,只是把工具调用转给守护进程。-- WDA 用你的**免费 Apple ID** 签名。免费签名 7 天过期,守护进程会在到期前自动重签。-- WDA 不可用时(例如正在重启),点击、滑动、按键和截图改走 CoreDevice HID,照样能用(要 iOS 27 及以上)。+- iOS 27 及以上改回用 WDA(`ICTL_IOS_BACKEND=wda`)时,WDA 不可用期间(例如正在重启)点击、滑动、按键和截图改走 CoreDevice HID,照样能用。## 兼容性| | ||---|---|| 主机 | Linux,x86_64 或 arm64:一行命令安装、Homebrew 或 deb 包(Debian 12+、Ubuntu 22.04+),要系统的 usbmuxd;也可以用 Rust 1.89+ 从源码编译<br>macOS,Apple Silicon:一行命令安装或 Homebrew,也可以从源码编译,见 [macOS](../deploy/macos)<br>不支持 Windows |-| 手机 | iPhone 或 iPad,iOS 17 及以上;HID 后备路线要 iOS 27 及以上 |-| 已在真机验证 | iPhone 15 Pro Max,iOS 27.0.1(Linux、macOS)<br>iPhone 12 mini,iOS 26.4.1(Linux)<br>iPad mini 5,iOS 26.6.1(Linux) |-| 账号 | 免费 Apple ID 即可,建议专门注册一个 |+| 手机 | iPhone 或 iPad,iOS 17 及以上。**推荐 iOS 27 及以上**(原生控制);iOS 17–26 经 WebDriverAgent |+| 已在真机验证 | iPhone 15 Pro Max,iOS 27.2.1,原生控制(Linux)<br>iPhone 15 Pro Max,iOS 27.0.1,WDA(Linux、macOS)<br>iPhone 12 mini,iOS 26.4.1(Linux)<br>iPad mini 5,iOS 26.6.1(Linux) |+| 账号 | iOS 27 及以上(原生控制)不需要;iOS 26 及以下要一个免费 Apple ID,建议专门注册一个 |其他机型和 iOS 版本应该也能用,但还没测过,欢迎[反馈](https://github.com/Derrors/iphone-control/issues)。@@ -40,16 +43,17 @@ iphone-control 让 AI agent(例如 Claude)操作一台用数据线接在 Lin**需要你在手机上操作**-- 不绕过任何 iOS 安全机制:信任电脑、打开开发者模式、信任开发者证书、启用 UI 自动化,都需要你在手机上亲自操作一次。-- 手机重启后,第一次解锁(BFU)必须人工完成,还要再输一次密码允许 UI 自动化,这是 iOS 的要求。+- 不绕过任何 iOS 安全机制:信任电脑、打开开发者模式,都需要你在手机上亲自操作一次;用 WDA 时还要信任开发者证书、启用 UI 自动化。+- 手机重启后,第一次解锁(BFU)必须人工完成,这是 iOS 的要求;用 WDA 时还要再输一次密码允许 UI 自动化。**使用**- 一台主机可以接多台 iPhone/iPad,但同一时间只控制一台,见[多台设备](./multi-device)。不要让两份 iphone-control 或其他基于 usbmuxd 的工具连同一台。- 游戏、地图、视频这类界面没有元素树,agent 只能看截图按坐标操作。-- HID 后备路线要 iOS 27 及以上;更早的 iOS 全部经 WebDriverAgent 操作,WDA 重启期间操作会失败。-- 免费 Apple ID 的描述文件 7 天有效。重签是自动的,但 Apple ID 会话失效后要运行 `login` 重新登录。-- 登录 Apple ID 默认用公共的第三方 anisette 服务,可以设 `ICTL_ANISETTE_URL` 换成自建服务,见[配置](./configuration)。+- 原生控制(iOS 27 及以上):屏幕外的列表行读不到,要先滑到才找得到;输入文字一律经剪贴板粘贴,守护进程会自动点「允许粘贴」,输完还原剪贴板。+- iOS 26 及以下全部经 WebDriverAgent 操作,没有 HID 后备,WDA 重启期间操作会失败。+- 用 WDA 时:免费 Apple ID 的描述文件 7 天有效。重签是自动的,但 Apple ID 会话失效后要运行 `login` 重新登录。+- 用 WDA 时,登录 Apple ID 默认用公共的第三方 anisette 服务,可以设 `ICTL_ANISETTE_URL` 换成自建服务,见[配置](./configuration)。**macOS**diff --git a/website/index.md b/website/index.mdindex d6fa5c0..3680a83 100644--- a/website/index.md+++ b/website/index.md@@ -4,7 +4,7 @@ layout: homehero:name: iphone-controltext: 让 AI agent 操作真实的 iPhone- tagline: 在 Linux 或 Mac 上通过 USB 控制 iPhone 或 iPad,以 MCP 工具交给 Claude 等 AI。不需要 Xcode,不需要付费开发者账号。+ tagline: 在 Linux 或 Mac 上通过 USB 稳定、高效地控制 iPhone 或 iPad,以 MCP 工具交给 Claude 等 AI。不需要 Xcode,不需要付费开发者账号;推荐 iOS 27 及以上,连 Apple ID 都不用。image:src: /logo.svgalt: iphone-control@@ -22,26 +22,26 @@ hero:features:- icon: 🤖title: 给 AI 用的工具- details: 截图、读屏幕元素、按文字点击、滑动、输入中文、启动 App、等页面加载、一次执行多步,共 17 个 MCP 工具- - icon: 💻- title: Linux 或 Mac 都行- details: Linux 上不需要 Mac,Mac 上不需要 Xcode。用免费 Apple ID 给 WebDriverAgent 签名,7 天到期前自动重签+ details: 截图、读屏幕元素、按文字点击、滑动、输入中文、启动 App、等页面加载、一次执行多步,共 17 个 MCP 工具;操作后顺带返回稳定后的界面+ - icon: ⚡+ title: iOS 27 原生控制+ details: iOS 27 及以上默认原生控制:手机上什么都不装,不用 Apple ID、不用签名,几秒就绪。推荐用 iOS 27 及以上的设备+ - icon: 📱+ title: iOS 17–26 也能用+ details: 经 WebDriverAgent 控制,用免费 Apple ID 签名,7 天到期前自动重签。这条路线继续维护- icon: 🔁title: 自己维持运行- details: 自动配对、挂载开发者镜像、拉起 WDA;拔插、重启、WDA 崩溃后自动恢复- - icon: 🛟- title: 后备路线- details: WDA 不可用时,点击、滑动、按键、截图仍可经 CoreDevice HID 完成(iOS 27 起)+ details: 常驻守护进程独占手机,拔插、重启、断连后自动恢复;不开控制台也一直提供服务+ - icon: 🙋+ title: 人工把关+ details: AI 任务可以随时暂停、接管、停止;付款、删除、发消息之前要你确认,Agent 不能批准自己的任务+ - icon: 🖥️+ title: 可选的控制台+ details: 浏览器里看实时画面、直接操作、下达任务;可以对局域网开放,别的机器上的 AI 经 HTTP MCP 接入。默认不开端口- icon: 🔔title: 需要你时会通知- details: 重签失败、Apple ID 会话失效、重启后要输密码、手机离线时,经 Bark 或 Telegram 推送- - icon: 🔒- title: 默认不开端口- details: WDA 经 usbmuxd 直连手机,本机不监听任何网络端口;自动解锁默认关闭+ details: 手机离线、重启后要输密码、重签失败时,经 Bark 或 Telegram 推送- icon: 📦title: 一个二进制details: Rust 编写。一行命令、Homebrew 或 deb 包安装,运行 iphone-control 一步步带你设置好;也可以从源码编译- - icon: 🧭- title: 省往返- details: 操作可以顺带返回操作后的界面,自动等界面稳定、识别加载中和挡路的弹窗---diff --git a/website/public/architecture-dark.svg b/website/public/architecture-dark.svgindex f8d6900..8f512c8 100644--- a/website/public/architecture-dark.svg+++ b/website/public/architecture-dark.svg@@ -1,4 +1,4 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600" width="1200" height="600" role="img" aria-label="iphone-control architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB through WebDriverAgent, with CoreDevice HID as fallback">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600" width="1200" height="600" role="img" aria-label="iphone-control architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB, natively on iOS 27 and later and through WebDriverAgent below that"><title>iphone-control architecture</title><defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">@@ -42,23 +42,23 @@<text x="349" y="350" class="label" text-anchor="middle">Unix</text><text x="349" y="396" class="label" text-anchor="middle">socket</text>- <text x="48" y="500" class="sub">Nothing listens on the network.</text>- <text x="48" y="526" class="sub">WebDriverAgent is reached through usbmuxd.</text>+ <text x="48" y="500" class="sub">Works with the control page closed.</text>+ <text x="48" y="526" class="sub">The page and remote MCP are opt-in.</text><!-- daemon --><rect x="392" y="88" width="496" height="468" rx="20" fill="#0b2a33" stroke="#22d3ee" stroke-width="2"/><text x="420" y="130" class="h2" style="fill:#22d3ee">iphone-control daemon</text><text x="420" y="160" class="sub">one long-running process owns the phone</text><rect x="420" y="186" width="440" height="100" rx="14" fill="#0d1117" stroke="#155e75" stroke-width="1.5"/>- <text x="444" y="228" class="h3">WebDriverAgent client</text>+ <text x="444" y="228" class="h3">Native control</text><rect x="752" y="206" width="88" height="30" rx="15" fill="#22d3ee"/>- <text x="796" y="227" class="pill" style="fill:#0d1117" text-anchor="middle">primary</text>- <text x="444" y="260" class="sub">element tree · tap · type · screenshot</text>+ <text x="796" y="227" class="pill" style="fill:#0d1117" text-anchor="middle">iOS 27+</text>+ <text x="444" y="260" class="sub">accessibility · HID · nothing on the phone</text><rect x="420" y="306" width="440" height="100" rx="14" fill="#0d1117" stroke="#155e75" stroke-width="1.5"/>- <text x="444" y="348" class="h3">CoreDevice HID</text>+ <text x="444" y="348" class="h3">WebDriverAgent client</text><rect x="752" y="326" width="88" height="30" rx="15" fill="#fbbf24"/>- <text x="796" y="347" class="pill" style="fill:#0d1117" text-anchor="middle">fallback</text>- <text x="444" y="380" class="sub">tap · swipe · keys · screenshot while WDA is down</text>+ <text x="796" y="347" class="pill" style="fill:#0d1117" text-anchor="middle">iOS 17–26</text>+ <text x="444" y="380" class="sub">for older iOS · signed with a free Apple ID</text><rect x="420" y="426" width="440" height="100" rx="14" fill="#0d1117" stroke="#155e75" stroke-width="1.5"/><text x="444" y="468" class="h3">Supervisor</text><text x="444" y="500" class="sub">usbmuxd · reconnect · disk image · re-sign · notify</text>@@ -75,15 +75,15 @@<text x="1080" y="196" text-anchor="middle" style="fill:#ffffff;font-size:20px;font-weight:700">iPhone / iPad</text><text x="1080" y="222" text-anchor="middle" style="fill:#ffffff;font-size:15px;opacity:.8">iOS 17+</text><rect x="1018" y="262" width="124" height="64" rx="12" fill="#ffffff" fill-opacity="0.14"/>- <text x="1080" y="290" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">WebDriver</text>- <text x="1080" y="312" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">Agent</text>- <text x="1080" y="378" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">signed with a</text>- <text x="1080" y="396" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">free Apple ID</text>+ <text x="1080" y="290" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">iOS 27+</text>+ <text x="1080" y="312" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">no install</text>+ <text x="1080" y="378" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">older iOS:</text>+ <text x="1080" y="396" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">WebDriverAgent</text><!-- outbound internet --><path d="M862 476 C 904 476, 920 506, 944 506" fill="none" stroke="#9198a1" stroke-width="2" stroke-dasharray="6 5" marker-end="url(#arrow)"/><rect x="948" y="456" width="236" height="100" rx="16" fill="#2b2111" stroke="#d4a72c" stroke-width="1.5"/><text x="970" y="490" class="h3" style="font-size:17px">Outbound HTTPS</text>- <text x="970" y="516" class="sub">Apple ID · anisette</text>+ <text x="970" y="516" class="sub">Apple ID (WDA only)</text><text x="970" y="538" class="sub">Bark · Telegram</text></svg>diff --git a/website/public/architecture-light.svg b/website/public/architecture-light.svgindex 73775e4..ca1bf84 100644--- a/website/public/architecture-light.svg+++ b/website/public/architecture-light.svg@@ -1,4 +1,4 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600" width="1200" height="600" role="img" aria-label="iphone-control architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB through WebDriverAgent, with CoreDevice HID as fallback">+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600" width="1200" height="600" role="img" aria-label="iphone-control architecture: an MCP client talks to iphone-control mcp over stdio, which talks to the daemon over a Unix socket; the daemon drives the iPhone or iPad over USB, natively on iOS 27 and later and through WebDriverAgent below that"><title>iphone-control architecture</title><defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">@@ -42,23 +42,23 @@<text x="349" y="350" class="label" text-anchor="middle">Unix</text><text x="349" y="396" class="label" text-anchor="middle">socket</text>- <text x="48" y="500" class="sub">Nothing listens on the network.</text>- <text x="48" y="526" class="sub">WebDriverAgent is reached through usbmuxd.</text>+ <text x="48" y="500" class="sub">Works with the control page closed.</text>+ <text x="48" y="526" class="sub">The page and remote MCP are opt-in.</text><!-- daemon --><rect x="392" y="88" width="496" height="468" rx="20" fill="#ecfeff" stroke="#0891b2" stroke-width="2"/><text x="420" y="130" class="h2" style="fill:#0e7490">iphone-control daemon</text><text x="420" y="160" class="sub">one long-running process owns the phone</text><rect x="420" y="186" width="440" height="100" rx="14" fill="#ffffff" stroke="#a5f3fc" stroke-width="1.5"/>- <text x="444" y="228" class="h3">WebDriverAgent client</text>+ <text x="444" y="228" class="h3">Native control</text><rect x="752" y="206" width="88" height="30" rx="15" fill="#0e7490"/>- <text x="796" y="227" class="pill" style="fill:#ffffff" text-anchor="middle">primary</text>- <text x="444" y="260" class="sub">element tree · tap · type · screenshot</text>+ <text x="796" y="227" class="pill" style="fill:#ffffff" text-anchor="middle">iOS 27+</text>+ <text x="444" y="260" class="sub">accessibility · HID · nothing on the phone</text><rect x="420" y="306" width="440" height="100" rx="14" fill="#ffffff" stroke="#a5f3fc" stroke-width="1.5"/>- <text x="444" y="348" class="h3">CoreDevice HID</text>+ <text x="444" y="348" class="h3">WebDriverAgent client</text><rect x="752" y="326" width="88" height="30" rx="15" fill="#fbbf24"/>- <text x="796" y="347" class="pill" style="fill:#1f2328" text-anchor="middle">fallback</text>- <text x="444" y="380" class="sub">tap · swipe · keys · screenshot while WDA is down</text>+ <text x="796" y="347" class="pill" style="fill:#1f2328" text-anchor="middle">iOS 17–26</text>+ <text x="444" y="380" class="sub">for older iOS · signed with a free Apple ID</text><rect x="420" y="426" width="440" height="100" rx="14" fill="#ffffff" stroke="#a5f3fc" stroke-width="1.5"/><text x="444" y="468" class="h3">Supervisor</text><text x="444" y="500" class="sub">usbmuxd · reconnect · disk image · re-sign · notify</text>@@ -75,15 +75,15 @@<text x="1080" y="196" text-anchor="middle" style="fill:#ffffff;font-size:20px;font-weight:700">iPhone / iPad</text><text x="1080" y="222" text-anchor="middle" style="fill:#ffffff;font-size:15px;opacity:.8">iOS 17+</text><rect x="1018" y="262" width="124" height="64" rx="12" fill="#ffffff" fill-opacity="0.14"/>- <text x="1080" y="290" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">WebDriver</text>- <text x="1080" y="312" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">Agent</text>- <text x="1080" y="378" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">signed with a</text>- <text x="1080" y="396" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">free Apple ID</text>+ <text x="1080" y="290" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">iOS 27+</text>+ <text x="1080" y="312" text-anchor="middle" style="fill:#ffffff;font-size:15px;font-weight:600">no install</text>+ <text x="1080" y="378" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">older iOS:</text>+ <text x="1080" y="396" text-anchor="middle" style="fill:#ffffff;font-size:13px;opacity:.8">WebDriverAgent</text><!-- outbound internet --><path d="M862 476 C 904 476, 920 506, 944 506" fill="none" stroke="#59636e" stroke-width="2" stroke-dasharray="6 5" marker-end="url(#arrow)"/><rect x="948" y="456" width="236" height="100" rx="16" fill="#fff8e6" stroke="#d4a72c" stroke-width="1.5"/><text x="970" y="490" class="h3" style="font-size:17px">Outbound HTTPS</text>- <text x="970" y="516" class="sub">Apple ID · anisette</text>+ <text x="970" y="516" class="sub">Apple ID (WDA only)</text><text x="970" y="538" class="sub">Bark · Telegram</text></svg>diff --git a/website/troubleshoot/faq.md b/website/troubleshoot/faq.mdindex 673c431..2db64af 100644--- a/website/troubleshoot/faq.md+++ b/website/troubleshoot/faq.md@@ -15,6 +15,8 @@ iphone-control doctor # 逐层检查,每项失败都给出修复办法| 未配对 | 没有配对记录 | 运行 `setup --reconfigure` 选「手机」,手机上点「信任」 || 开发者模式未打开 | — | 在手机的 设置 → 隐私与安全性 → 开发者模式 打开。手机被开发者工具连接过才会出现这个开关,运行 `setup --reconfigure` 选「手机」会处理 || 手机锁屏,隧道建不起来 | 重启后还没解锁过 | 手动解锁一次;解锁前状态一直是这个,守护进程会定期重试 |+| 正在准备手机(挂载开发者镜像、连接无障碍服务) | 原生控制(iOS 27 及以上)正在准备 | 等一下,通常几秒到半分钟;保持手机解锁 |+| 准备手机失败,稍后重试:… | 原生控制没准备好 | 看冒号后的错误,运行 `doctor`,见[原生控制准备不好](#native-control) || WDA 还没签名安装 | — | 运行 `sign` 或 `setup` || 正在启动 WDA | 最长约 2 分钟 | 等一下。iOS 27 起期间点击、滑动、截图走 HID 后备,仍可用,但横屏时要 30 秒内从 WDA 拿到过方向,否则拒绝触摸;屏幕尺寸未知时报错,见[工具一览](../guide/tools#wda-不可用时-hid-后备)。更早的 iOS 要等 WDA 起来 || WDA 卡在手机上的「Enable UI Automation」密码框 | 手机在等「为 XCTest 输入 iPhone 密码」 | 在手机上输入锁屏密码。手机重启后会出现,连续重启守护进程几次后有时也会。守护进程每 60 秒重试,只通知一次 |@@ -31,8 +33,18 @@ iphone-control doctor # 逐层检查,每项失败都给出修复办法- **充电时大约每分钟断开一次:** 手机开着「设置 → 电池 → 充电 → 80% 上限」时,在 80% 附近反复开始、停止充电,每次 USB-C 重新协商供电都会让 USB 断开 3~5 秒。用来做自动化的手机把上限改成 100%。- **Mac 上:** usbmuxd 是系统自带的,`doctor` 报连不上时运行 `sudo launchctl kickstart -k system/com.apple.usbmuxd`。见 [macOS](../deploy/macos)。+## 原生控制准备不好 {#native-control}++iOS 27 及以上默认原生控制,只要配对、开发者模式、开发者镜像和无障碍服务。`status` 一直是「准备手机失败」时:++- **开发者镜像下载失败:** 要能访问 GitHub,配好代理(`iphone-control setup --reconfigure` 选「代理」)。+- **手机锁着:** 准备时手机要保持解锁。+- **还是不行:** 运行 `doctor` 看卡在哪一层,[提 issue](https://github.com/Derrors/iphone-control/issues/new/choose)。临时可以在 `~/.config/iphone-control/env` 里设 `ICTL_IOS_BACKEND=wda` 改回 WDA,再 `iphone-control service restart`(要 Apple ID,见下一节)。+## WDA 起不来+只对用 WDA 的设备:iOS 26 及以下,或设了 `ICTL_IOS_BACKEND=wda` 的。+- **「不受信任的开发者」:** 首次安装后在 设置 → 通用 → VPN 与设备管理 里信任你的 Apple ID(手机要联网)。- <a id="cert"></a>**签名证书被吊销了:**`status` 报 `unexpected response`,描述文件却还有效;在设备上点 WebDriverAgentRunner 图标提示「无法验证 App」。- 原因:每个安装(每台机器、每个数据目录)有自己的签名私钥和证书,免费 Apple ID 同时最多两张证书。在新地方第一次签名(换机器、从 Docker 换成本机安装、删了数据目录),或在 AltStore、SideStore 等侧载工具里用同一个 Apple ID 签名,都会新建证书;满了就吊销一张旧的,用它签的 App 在每台设备上都起不来。