Skip to content

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

docs: a short changelog, one line per change (#126)

Qinghe Li4d9d474b60ad
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e06a236..21ab21c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -112,13 +112,15 @@ jobs:
{
echo "## English"; echo; echo "$en"; echo
echo "## 中文"; echo; echo "$zh"; echo
+ # 已装的程序在「---」加「**Binaries / 二进制:**」处截掉页脚,按「## English」「## 中文」分语言,这三处别改
echo "---"; echo
- echo "**Binaries / 二进制:** \`linux-x86_64\`, \`linux-aarch64\` (glibc 2.34+), \`macos-arm64\` (macOS 11+, Apple Silicon); \`.deb\` amd64, arm64 (Debian 12+, Ubuntu 22.04+)"; echo
- echo "**Debian/Ubuntu:** \`sudo apt install ./iphone-control_${version}_amd64.deb\` (or \`_arm64.deb\`)"
+ echo "**Binaries / 二进制:** macOS \`macos-arm64\` (11+, Apple Silicon) · Linux \`linux-x86_64\`, \`linux-aarch64\` (glibc 2.34+) · \`.deb\` amd64, arm64 (Debian 12+, Ubuntu 22.04+)"; echo
if [[ "$GITHUB_REF_NAME" != *-* ]]; then
- echo "**Installer:** \`curl -fsSL https://github.com/$GITHUB_REPOSITORY/releases/download/$GITHUB_REF_NAME/install.sh | sh\` (once the signed assets for your platform are available)"
- if [[ -n "$ICTL_UPDATE_TAP" ]]; then echo "**Homebrew:** \`brew install $ICTL_UPDATE_TAP/iphone-control\`"; fi
+ echo "- **Script / 脚本:** \`curl -fsSL https://github.com/$GITHUB_REPOSITORY/releases/download/$GITHUB_REF_NAME/install.sh | sh\`"
+ if [[ -n "$ICTL_UPDATE_TAP" ]]; then echo "- **Homebrew:** \`brew install $ICTL_UPDATE_TAP/iphone-control\`"; fi
fi
+ echo "- **Debian / Ubuntu:** \`sudo apt install ./iphone-control_${version}_amd64.deb\` (or / 或 \`_arm64.deb\`)"; echo
+ echo "Already installed? Run \`iphone-control update\`. / 已安装的运行 \`iphone-control update\` 升级。"
} > notes.md
- name: Create release
run: |
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06188b5..a4633d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,353 +2,298 @@
**English** | [简体中文](CHANGELOG.zh-CN.md)
-All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/) (while at 0.x, minor versions may contain breaking changes).
+What changed in each release, one line per change. Versions follow [Semantic Versioning](https://semver.org/); while at 0.x a minor version may break things, so read *Upgrade notes* first.
## [Unreleased]
-### Added
+### Upgrade notes
+
+- Phones on iOS 27 and later switch to native control. To keep WebDriverAgent, set `ICTL_IOS_BACKEND=wda` in `~/.config/iphone-control/env` (#123).
+- Building from source needs Rust 1.89 (#119).
-- Phones on iOS 27 and later are driven without WebDriverAgent by default (native control): no Apple ID, no signing, no WDA; the daemon mounts the developer disk image, connects to the accessibility service (remoteAXService) and is ready, usually within seconds. The screen is read element by element from the accessibility service (types, text, values, ids and frames as WDA has them, so tapping by text, covered elements, system alerts and banners work as before); taps, swipes, long presses, buttons and Home go through HID; text is always pasted: “Allow Paste” is tapped, the field read back, and the pasteboard put back at once. Apps and links launch through CoreDevice, quitting sends SIGKILL, the lock state comes from lockdown, and auto-unlock follows the same rules as through WDA. When Home doesn't reach the home screen, a swipe up from the bottom edge does. `iphone-control setup` skips the Apple ID and signing for such a phone; `status`, `doctor` and the control page say “native”. To go back to WDA, set `ICTL_IOS_BACKEND=wda` in `~/.config/iphone-control/env`. A WDA already installed stays and is still re-signed. iOS 26 and earlier are unchanged. A WDA launched in the background (`ICTL_WDA_DETACHED`) while WDA was in use is ended when the phone is prepared (SIGKILL through CoreDevice AppService; DVT's `kill_app` leaves WDA running).
-- While WebDriverAgent is unavailable, `iphone_type_text` can enter Chinese and other text a US keyboard can't type: HID puts it on the phone's pasteboard (CoreDevice `pasteboardservice`, checked by reading it back) and presses Cmd-V, so the input method doesn't turn it into pinyin. iOS treats that text as coming from another app and asks “… would like to paste from dtpasteboardd” every time (iPhone 15 Pro Max, iOS 27.2.1, Notes); the answer says to take a screenshot and tap “Allow Paste”. Changing the pasteboard closes that prompt, so what was on it before is put back 45 s later (or before the next such paste, or when another device is chosen), and only if the pasted text is still there. Return isn't pressed with `submit`, since with the prompt up it would choose “Don't Allow Paste”. English letters and symbols are still typed as keys and don't touch the pasteboard.
-- An action with `then` says whether the screen changed: the screen after it settles is compared with what was read just before it (an element list, a screenshot, or the tree a tap by text reads before tapping). "The same as before" adds that the action may not have taken effect and to look before trying it again. Nothing is added when the screen wasn't looked at since the action before. On a phone (iPhone 15 Pro Max, iOS 27.2.1, Settings): a tap on an empty spot said "the same", opening General and going back said "changed".
+### New
-### Changed
+- iOS 27 and later work without WebDriverAgent: no Apple ID, no signing, ready in seconds. iOS 26 and earlier are unchanged (#123).
+- Chinese and other non-ASCII text can be typed while WebDriverAgent is down. Tap "Allow Paste" when the phone asks (#118).
+- Actions with `then` say whether the screen changed, so an agent can tell when a tap did nothing (#121).
-- The daemon always launches WDA in the background and no longer holds an XCTest session: WDA starts on a locked phone too, keeps running across daemon restarts and updates, and is attached to again after switching devices and back. The experimental switch `ICTL_WDA_DETACHED` is gone; left in the settings file it does nothing (`=0` doesn't bring back the old way either). `iphone-control service stop` and `service uninstall` end it. See docs/decisions.md D18.
-- Building from source needs Rust 1.89 (was 1.88), for uuid 1.29.
-- Dependencies updated: rmcp 3.10.0, rcgen 0.14.10, console 0.16.6, sha2 0.11.1, uuid 1.29.2, zip 9.5.1, flate2 1.1.11, and 26 indirect ones within their compatible versions (rustls-webpki, mio, openssl, webpki-roots and others). rcgen keeps to ring only (its default would also build aws-lc). The vendored plume_core makes its signing request with rcgen 0.14 and apple-codesign uses dialoguer 0.12, so each of rcgen and console is built once instead of in two versions. x509-certificate stays at 0.24 and rsa at 0.9: apple-codesign and its dependencies use those, and a newer copy of ours would only be built beside them. The control page's self-made HTTPS certificate is still ECDSA P-256; one made before keeps working.
-- CI: actions/setup-node 7, dorny/paths-filter 4. Website: vue 3.5.45.
+### Improvements
-### Fixed
+- Dependencies updated (#119).
-- With WDA launched in the background (`ICTL_WDA_DETACHED`): `iphone-control service stop` and `service uninstall` now end the background WDA on the connected phones once the service is stopped, instead of leaving it running (`service restart` and updates still don't interrupt it). Each phone keeps its own background WDA across device switches, so switching back attaches to it instead of launching a new one.
-- An arrow key in the setup guide's menus (`iphone-control setup`) could come out as a letter on a busy machine: when the program was descheduled for more than 250 ms in the middle of reading the key, the rest of its bytes, though already there, were dropped and the last one taken as typed (↓ as "B"). Bytes already received are now always read.
-- A tap or swipe a minute or more after the last one no longer waits for the screen size to be measured again first: that takes WDA 0.95 s on an iPad mini 5 (iPadOS 26.7.3), where the first tap after a pause took 1.7 s instead of 0.9. The size is now measured again in the background while nobody acts (only Display Zoom changes it), and on rotation as before.
-- A control page whose H.264 or the phone's own video didn't show a first frame within 9 s (the viewer or daemon restarting, the encoder starting up) used MJPEG until it was reloaded; it now tries again after 30 s, 1 min and 2 min. A picture the viewer said isn't available still isn't tried again.
-- A swipe on the control page through WDA no longer waits for the list to stop before answering (reading the element tree again and again, up to 2.5 s): the person at the page sees it. On an iPad mini 5 a swipe took 3.1 s, now 1.6–2.3 s. Agents (MCP, CLI) still wait, so their next tap doesn't land on a moving list.
-- The way Home and locking work on each device is kept in `state.json` instead of only in memory. After the daemon restarted, or another device was controlled meanwhile, the first Home on a device where IOHID's Home doesn't work tried it, waited 2 s for the home screen and pressed again: 4.4 s instead of 0.8 on an iPad mini 5.
-- A tap, swipe, key or launch that WebDriverAgent didn't answer in time no longer carries on later. WDA handles requests one at a time and keeps going after we stop waiting, so an action queued behind a slow one could land on the screen long after it was reported as failed. The daemon now ends that WDA session at once (`DELETE /session`, which WDA 16.15.3 answers outside its queue and which drops what is still queued in it) and opens a new one for the next action. A read that times out keeps its session.
-- Reading the element tree of a screen with very many elements (long feeds and lists) no longer keeps taking as long. A read over 8 s, or one that times out, makes the next read ask WDA for a smaller snapshot (at most 150 children per element first, then half the depth and children, down to 12 levels and 60 children); a read under 1.5 s loosens it a step again. While the tree is cut short, `iphone_list_elements` and a `iphone_tap_element` that finds nothing say so.
-- A tap by text, an element list or `then=elements` with a notification banner at the top read SpringBoard's tree instead of the app's (seen on a phone with the "Device Hub" banner: a button in Notes wasn't found). WDA tells the app in front by what is under one point, which by default is 20% of the short side from the top left corner: (86, 86) on a 430-point iPhone, under the banner. It is now moved to half the short side from that corner, (215, 215), once per WDA start.
-- The HID fallback's paste (non-ASCII text while WebDriverAgent is unavailable) writes to the phone's pasteboard as local only. It wrote without source metadata, and then the phone's pasteboard daemon offers the write to the owner's other Apple devices through Universal Clipboard, so the text typed, and the old contents put back afterwards, could replace a Mac's clipboard too (as Pinky's notes on the service describe; not checked on a Mac here). It now names itself in the write's source metadata, as Xcode does. The phone still asks to "Allow Paste" in Notes.
+### Fixes
+
+- `service stop` and `service uninstall` also end a WDA launched in the background, and each phone keeps its own (#124).
+- Text pasted on the phone no longer reaches your Mac through Universal Clipboard (#122).
+- With a notification banner up, elements are read from the app instead of the banner (#121).
+- Arrow keys in setup menus no longer turn into letters on a busy machine (#120).
+- A tap or key that WDA didn't answer in time no longer lands on the screen later (#118).
+- Screens with very many elements read faster, and the result says when the list was cut short (#118).
+- The first tap after a pause no longer waits for the screen size to be measured (#110).
+- The control page retries H.264 or the phone's video after a slow start instead of staying on MJPEG (#109).
+- Swipes on the control page return sooner (#108).
+- The first Home after a daemon restart is no longer slow on some devices (#107).
## [0.2.6] - 2026-11-14
-### Added
+### New
-- Low-bandwidth mode for the control page's picture: a switch in Settings, for use over the internet or a weak signal. The phone's own video (HEVC) is asked for with a 2 Mbit/s cap instead of 6, about half the traffic at the same frame rate (on an iPhone's home screen 214 KB/s instead of 459–483 while swiping); a still screen looks the same, moving content gets a little blocky. There is one such stream per phone, so while any page watching it has the mode on, all of them get it, and the stream starts again (the picture stops for about half a second) when the first such page comes and when the last one goes. The H.264 picture changes only for that page (qp 26: 689 KB/s instead of 1350).
+- Low-bandwidth mode for the control page's picture, in Settings: about half the traffic (#104, #105).
-### Changed
+### Improvements
-- The control page's requests share a connection instead of opening one each (`Connection: keep-alive`). Over Wi-Fi a new connection and its TLS handshake cost two more round trips, for every tap, every check and each of the ten reports a second on the picture. With a 40 ms round trip a request from the page went from about 220 ms to 47 ms, and about 40 s on the page opened 19 connections instead of 763. A connection is kept only for a logged-in request, closes after 15 s of nothing, and isn't kept when fewer than 8 of the 32 places are free; streams (the picture, task events, `/mcp`) still have their own.
+- The control page reuses its connections, so taps and checks over Wi-Fi answer several times faster (#103).
-### Fixed
+### Fixes
-- A control page watching the phone's own video got no more frames, and wasn't closed, when the phone's media stream was stopped and started again (the daemon's side of each page held the stream's channel open); it now hears that the stream ended and reconnects.
-- Home on the control page is pressed at once: about 0.5 s instead of 1 s on an iPhone's home screen. The daemon first looked for a system alert that would stop Home working (0.8 s on the home screen), which the person at the page sees anyway; the page's requests now say someone is watching (`watched`), and for them the daemon looks only when the press didn't get to the home screen. Agents (MCP, CLI) are checked first as before.
-- Taps and Home presses on the control page no longer wait behind its background checks. While it shows the phone's own picture the page asks every few seconds whether a system alert is up, which on the home screen keeps WDA busy for about 0.8 s, and its status check takes the phone too: an action that came meanwhile waited for them. These checks now give way: they don't start within 4 s (the status: 1 s) of an action, nor while one waits, and one that runs is dropped when an action comes. With the page checking, a finger's press went from 775 ms to 25 ms at the 90th percentile, a Home press from 1.8 s to 1.3 s.
-- The phone's own picture (HEVC) on the control page no longer stops for half a second to a second now and then over Wi-Fi. A report from the page that came a few hundred milliseconds late made the picture skip to the next keyframe; frames now wait up to 400 ms for such a page, the allowance follows how much the link's round trip varies, and the page has two reports on the way at most instead of one. Under emulated Wi-Fi delays the longest stop went from 1.1 s to 0.1 s.
+- The phone's video on the control page no longer stutters over Wi-Fi (#100).
+- Taps and Home on the control page no longer wait behind the page's background checks (#101).
+- Home on the control page responds in about half the time (#102).
+- The control page picks up the phone's video again after the phone restarts its stream (#104).
## [0.2.5] - 2026-11-14
### Upgrade notes
-- `--url` (`mcp --url`, `task … --url`, `IPHONE_CONTROL_URL`) no longer takes `http://` for another machine, so the login token isn't sent in the clear: use `https://<address>:<port>` (with `--ca` for the self-signed certificate). `http://127.0.0.1` on this machine works as before.
-- A read-only token no longer has the phone unlocked for it: while the phone is locked, its element list says the phone is locked.
+- `--url` to another machine needs `https://` (with `--ca` for a self-signed certificate). `http://127.0.0.1` still works (#89).
+- A read-only token no longer unlocks the phone (#89).
-### Changed
+### Improvements
-- The control page's login page looks like the control page: its colours, light or dark as chosen there (or as the system), the same frosted card. The token field can show what was pasted, the `viewer token` command has a copy button, a wrong token is shown as an alert, and the page follows the language chosen on the control page, with a switch of its own.
-- The daemon is ready about 10 s sooner after it restarts or restarts WDA (1.4 s instead of 11 s on an iPhone): the outcome of starting WDA is taken as soon as it is there, not at the next check.
-- Waiting for the "Enable UI Automation" passcode, WDA is launched again every half minute instead of every three minutes. The prompt only comes up while WDA is being launched (for about 45 s, and not on every launch), so it is now on the phone most of the time instead of a quarter of it.
-- A stuck WDA is noticed after one unanswered request and a 5 s check, so a tool call waits about 35 s for the restart instead of 90 s.
-- Commands, MCP calls and the viewer wait (up to 10 s) for a daemon that is restarting instead of failing; a daemon that isn't running is still reported at once.
-- Too many wrong login tokens (20 in a minute) no longer lock out the right ones: a right token always gets in, and only wrong ones get 429. Before, anyone who could reach the page could cut off `mcp --url`, remote `task` commands and a remote task's agent.
-- `--url` takes `http://` only for this machine: tokens aren't sent in the clear to another one (use `https://`), and redirects aren't followed.
+- The login page matches the control page, with its own light/dark and language switches (#97).
+- Ready about 10 s sooner after the daemon or WDA restarts (#90).
+- While waiting for the "Enable UI Automation" passcode, the prompt is up on the phone most of the time (#90).
+- A stuck WDA is restarted after about 35 s instead of 90 s (#90).
+- Commands, MCP calls and the control page wait for a restarting daemon instead of failing (#90).
+- Too many wrong login tokens no longer lock out the right one (#89).
-### Fixed
+### Fixes
-- Without WDA, a device below iOS 27 (no HID fallback) is told so at once for taps, swipes and touches, like every other action, instead of an orientation error after a needless screenshot that suggested turning it to portrait.
-- A confirmation (`iphone_confirm`, or a step outside a task's apps) no longer cancels the user's pause or takeover: it is asked once the task runs again. Two at once are asked in turn; before, the first was counted as rejected and the second couldn't be answered.
-- A step the agent sent just before the user paused or took over no longer runs after it; a tap of the user's sent just before handing back no longer runs after that.
-- After the user handed back, the agent has to have actually seen the screen (a screenshot that worked) before acting.
-- A read-only token no longer makes the daemon unlock the phone (reading the elements of a locked phone now says it is locked).
-- Removing or replacing a login token now also ends the picture, task events, `/mcp` streams and task leases opened with it, within 5 s.
-- The control page's agent works in a private directory (under `$XDG_RUNTIME_DIR`, 0700) instead of one in `/tmp` that another user could make first and fill.
-- The viewer no longer stops accepting connections after an error such as running out of file descriptors; connections that never finish their request are dropped after 10 s (a machine on the network has at most 8 of them at a time); `GET /api/agent/tasks/events` no longer crashes the connection.
-- Task logs cut short by a power failure are removed instead of piling up.
+- Without WDA, devices below iOS 27 say at once that taps and swipes need it (#98).
+- A confirmation no longer undoes your pause or takeover, and two at once are asked in turn (#88).
+- A step the agent sent just before you paused, took over or handed back no longer runs after it (#88).
+- After you hand back, the agent has to look at the screen before acting (#88).
+- Removing or replacing a login token closes everything opened with it within 5 s (#89).
+- The control page's agent works in a private directory instead of `/tmp` (#89).
+- The control page keeps accepting connections after errors and drops stalled ones (#88).
+- Task logs cut short by a power failure are cleaned up (#88).
## [0.2.4] - 2026-11-14
### Upgrade notes
-- The control page (`iphone-control viewer`) and its `/mcp` now need a login, on this machine too. After upgrading, run `iphone-control viewer token` and open the link it prints; a browser stays logged in for 30 days. MCP clients connected to `/mcp` over HTTP need `Authorization: Bearer <token>` (`viewer token` prints the `claude mcp add` line). The CLI, `iphone-control mcp` over stdio and `task run` are unaffected.
-- With `--lan` (`IPHONE_CONTROL_VIEWER_LAN=1`) the page is HTTPS on the local network: open `https://<address>:<port>/` and check the certificate's fingerprint the first time (`iphone-control service status`).
-
-### Added
-
-- `iphone-control mcp --url https://<that machine>:8200` bridges stdio to another machine's viewer `/mcp`, so an MCP client that only starts a command can control the phone connected there. With a task's token only that is sent, otherwise the login from `IPHONE_CONTROL_VIEWER_TOKEN`; a command under `task run --url` has `IPHONE_CONTROL_URL` set, so a plain `iphone-control mcp` in it bridges by itself.
-- Every `task` subcommand takes `--url` (or `IPHONE_CONTROL_URL`): `list`, `events`, `pause`, `resume`, `takeover`, `handback`, `stop`, `approve` and `reject` work through another machine's viewer, with the login token in `IPHONE_CONTROL_VIEWER_TOKEN`.
-- Named login tokens, read-only ones among them: `iphone-control viewer token add <name> [--read-only]`, `list`, `show <name> [--new]`, `remove <name>`. A read-only token can watch the picture, the device's state and tasks; every action (taps, typing, starting, pausing or confirming tasks, switching devices, `/mcp`) is refused, and the page hides them. The task log records which token controlled it (`viewer:<name>`). Tokens moved to `viewer-tokens.json` and the earlier one became `owner`, so nobody logs in again after upgrading; adding, replacing and removing tokens takes effect at once, without restarting the viewer.
-- Tasks opened from another machine: `iphone-control task run --url https://<that machine>:8200 -- <command>` (the login token in `IPHONE_CONTROL_VIEWER_TOKEN`), or `POST /api/agent/tasks/open` directly, whose event stream is the lease. The agent on the other machine gets only the task's token: `/mcp` takes the token of an active task (header `Iphone-Control-Task-Token`), so it can act on the phone for that task but can't reach pausing or confirming, and can't approve itself.
-- The viewer and its `/mcp` need a login, from this machine too (the viewer can't tell a local browser from a visit forwarded by frp, cloudflared or another reverse proxy). The token is made on the first start and kept in `viewer-tokens.json` in the data directory (0600); `iphone-control viewer token` shows it with links that log in here and on the local network and the command to connect to the HTTP MCP, and `--new` replaces it. A browser stays logged in for 30 days; programs and MCP clients send `Authorization: Bearer <token>`. After too many wrong tokens (20 in a minute) wrong ones are answered with 429 for a minute. The CLI, `iphone-control mcp` (stdio) and `task run` use the local Unix socket and are unaffected.
-- MCP over HTTP: `/mcp` (Streamable HTTP) on the viewer's port serves the same tools as `iphone-control mcp`, for clients that only take a URL and for agents on another computer on the local network (`--lan`, over HTTPS), e.g. `claude mcp add --transport http iphone http://127.0.0.1:8200/mcp`. A task's agent sends the task's token in the `Iphone-Control-Task-Token` header. It needs the viewer's login, like the page; `--mcp off` (`IPHONE_CONTROL_VIEWER_MCP=off`) turns it off.
-- The viewer opened to the local network (`--lan`) now speaks HTTPS, on the same port: opened from another machine the picture can be H.264 or the phone's own HEVC instead of MJPEG, and traffic is encrypted. It uses a self-signed certificate made on this machine (kept in `viewer-tls/` in the data directory and reused); the browser warns the first time, so check the SHA-256 fingerprint shown at startup or by `service status` and go on. `--tls-cert`/`--tls-key` (`IPHONE_CONTROL_VIEWER_TLS_CERT`/`_KEY`) use a certificate of your own. `http://` from the network is redirected to `https://`; `http://127.0.0.1` on this machine works as before. `--tls off` (`IPHONE_CONTROL_VIEWER_TLS=off`) goes back to HTTP.
-- `iphone-control service viewer install` runs the viewer as a background service of its own that starts at login (`uninstall`, `start`, `stop`, `restart` too). It reads its port and whether it is open to the local network from the settings file (`IPHONE_CONTROL_VIEWER_PORT`, new; `IPHONE_CONTROL_VIEWER_LAN`; `IPHONE_CONTROL_VIEWER_LAN_HOSTS`, new) and keeps the installing shell's `PATH` to find `claude` and `codex`. Updates stop it and start it again; an automatic update waits while an AI task runs.
-- An AI task's agent can no longer pause, resume, take over, hand back or confirm its own task, so only a person answers out-of-scope steps and `iphone_confirm`. Control requests carrying the task's token (`IPHONE_CONTROL_TASK_TOKEN`) are refused, and so are those from an agent the control page or `task run` started, or any process it starts, even without the token or through the page's API. On macOS, calls through the page's API can't be traced to a process yet. Stopping a task is always allowed. The task's log records who controlled it (the page, the command line, the task's opener).
-- Navigate setup menus with arrow keys, confirm with Enter, or cancel with Esc. Number selection remains available, and basic terminals keep the line-by-line prompts.
-- Generate Bash, Zsh and Fish completion scripts with `iphone-control completions <shell>`, without starting the daemon or accessing a device.
-- `iphone-control viewer --lan` (or `IPHONE_CONTROL_VIEWER_LAN=1`) also opens the control page to the local network, on the same port, over HTTPS and behind the login (see above). It only accepts connections from local-network addresses and only answers to this machine's own names; `--lan-host` adds another name.
-- On the control page, a task can be limited to some apps before it starts (the App button next to the agent): in any other app each step waits for you, as with `task run --app`. The task card shows the scope, and running a task again keeps it.
-- AI tasks for any agent platform: `iphone-control task run -- <command>` runs a command in a task, and an `iphone-control mcp` it starts takes part (the control page shows its steps and can pause, take over, stop and confirm). `task list`, `task events`, `task pause`/`resume`/`takeover`/`handback`/`stop` and `task approve`/`reject` follow and steer tasks from the command line.
-- The control page picks up a task in progress: after a reload, and for tasks started elsewhere.
-- A task can be limited to some apps (`task run --app Settings`): in any other app, launching it, or opening a link that isn't a web page, each step waits for you to confirm; approving lets the task into that app.
-
-### Changed
-
-- On the control page the picture zooms only with the − and + buttons above it: pinching on a trackpad or touch screen, or Ctrl/⌘ + scroll, no longer zooms it (a drag easily turned into a zoom).
-- AI tasks are kept by the daemon instead of the control page. While a task runs, other clients (another MCP server, the command line) can look, but their actions and device switches are refused until the user takes over; the task stays on the device it started on. Tasks are logged in the data directory (`tasks/`, the last 50); one that was running when the daemon stopped shows as interrupted.
-
-### Removed
-
-- The `ICTL_AGENT_GATE` / `ICTL_AGENT_TOKEN` variables of the MCP server: a task's MCP server gets `IPHONE_CONTROL_TASK_TOKEN` instead.
-
-### Fixed
-
-- With several devices, every device's screen size is remembered: only the last one was, so after switching to another device and back, until WDA came up (say, stuck at the "Enable UI Automation" passcode prompt) the iOS 27 HID fallback didn't know the size, and screenshots, keys and taps failed with "the screen size is unknown".
-- Notification titles name the device: they always said "iPhone", also when an iPad needed its passcode, went offline or failed to re-sign, and with several devices you couldn't tell which. On an iPad the prompt is quoted as iOS shows it there ("Enter iPad passcode for XCTest"). `notify-test` samples use the controlled device.
-- Checking a new version during an update (running its `--version`) could fail now and then with "Text file busy": another thread started a process while the new program was still open for writing. It now waits a moment and tries again.
-- `task run`: a command that ended its task with `task finish` is no longer stopped on its way out with exit code 1. It now has 5 seconds to exit with its own code; if it is stopped after that, the exit code is 0 when the task completed.
-- Holding an arrow key in a setup menu keeps moving the selection without echoing key sequences into the menu.
-- AI task summaries on the control page are formatted: bold, lists, inline code and line breaks show as such instead of raw Markdown.
-- On iOS 27 and later, a system alert (a permission prompt such as "Allow Calendar to use your location?") that the live picture on the control page doesn't show is now drawn on the picture where it is, with its buttons; a button there taps it on the phone.
-- Locking no longer takes about 10 s every time on some iPhones (e.g. iPhone 15 Pro Max, iOS 27.0.1): pressing the power key via IOHID does nothing there, so the daemon remembers it per device and uses WDA's lock first (about 2 s).
-- Locking now works on iPads below iOS 27 (iPad mini 5, iPadOS 26.7.3: it never locked) and takes about 2 s instead of 10 s the first time on an iPhone 15 Pro Max: the power key via IOHID is now held 0.15 s instead of 0.1 s, which those devices ignored.
-- A WDA that still answers `/status` but no longer answers anything that goes through XCTest (foreground app, screenshots, elements, lock state all time out) is now noticed and restarted within about 30 s, also while tool calls keep the device busy (requests through XCTest stop waiting out their timeouts once three in a row went unanswered). Before, the daemon kept showing it as ready, and in background mode (`ICTL_WDA_DETACHED`) even a daemon restart attached to the stuck WDA again.
-- On devices below iOS 27, a lock that WDA could not carry out (neither the power key via IOHID nor WDA's own lock locked the screen) was reported as "WDA unavailable (just dropped)", although WDA was fine. It now says what each way of locking returned.
+- The control page and its `/mcp` need a login. Run `iphone-control viewer token` and open the link it prints. HTTP MCP clients send `Authorization: Bearer <token>`. The CLI and stdio MCP are unaffected (#79).
+- With `--lan`, the page is HTTPS on the local network. Check the certificate fingerprint from `service status` the first time (#76).
+- `ICTL_AGENT_GATE` and `ICTL_AGENT_TOKEN` are replaced by `IPHONE_CONTROL_TASK_TOKEN` (#64).
+
+### New
+
+- AI tasks for any agent: `iphone-control task run -- <command>`, steered with `task list`, `events`, `pause`, `resume`, `takeover`, `handback`, `stop`, `approve` and `reject` (#64).
+- Limit a task to some apps with `task run --app` or the App button on the control page. Anywhere else, each step waits for you (#69, #70).
+- An agent can't pause, approve or otherwise control its own task (#75).
+- The control page picks up running tasks after a reload, including ones started elsewhere (#64).
+- `viewer --lan` opens the control page to the local network over HTTPS (#72, #76).
+- MCP over HTTP at `/mcp` on the control page's port (#77).
+- Named and read-only login tokens: `viewer token add <name> [--read-only]` (#80).
+- Use another machine's phone: `mcp --url` bridges to its `/mcp`, and `task … --url` runs and controls tasks there (#80, #82).
+- `service viewer install` runs the control page as a background service (#74).
+- Arrow-key setup menus, and shell completions with `iphone-control completions <shell>` (#71).
+
+### Improvements
+
+- Tasks are kept by the daemon. While one runs, other clients can look but not act (#64).
+- The picture zooms only with its − / + buttons, not by pinching (#68).
+
+### Fixes
+
+- Locking takes about 2 s instead of 10 s on some iPhones, and now works on iPads below iOS 27 (#59, #63).
+- A WDA that still answers `/status` but nothing else is restarted within about 30 s (#60, #62).
+- A failed lock says what each way of locking did, instead of "WDA just dropped" (#61).
+- On iOS 27, system alerts missing from the phone's video are drawn on the picture and can be tapped (#67).
+- Task summaries on the control page are formatted instead of raw Markdown (#66).
+- Every connected device's screen size is remembered, not only the last one's (#86).
+- Notifications name the device instead of always saying "iPhone" (#85).
+- Updates no longer fail now and then with "Text file busy" (#81).
+- `task run` keeps the command's own exit code after `task finish` (#78).
+- Holding an arrow key in setup menus no longer prints escape codes (#73).
## [0.2.3] - 2026-11-13
### Upgrade notes
-- Upgrading from 0.2.2: its CLI has no bare `update` yet. For a managed service installed by the signed script, run `iphone-control update apply`; on Homebrew, `brew upgrade iphone-control`; on Debian / Ubuntu, download the `.deb` for your architecture from the release and install it with `sudo apt install ./<file>`. From 0.2.3 on, `iphone-control update` does it.
-
-### Added
+- From 0.2.2, upgrade once by hand: `iphone-control update apply` (script install), `brew upgrade iphone-control`, or `sudo apt install ./<file>.deb`. After that, `iphone-control update` does it (#51).
+- `update rollback` is gone. A new version that doesn't start is still replaced by the old one automatically (#52).
-- Run `iphone-control update` to check for a new stable release and install it through your managed service, Homebrew or Debian package. It reports when you already have the latest version. `update check` remains available for a check only.
-- `iphone-control update` says what it will do and asks before installing; `--yes` skips the question. After a Homebrew or Debian upgrade a running background service is restarted on the new version.
-- The Debian packages are signed by the publisher too; `iphone-control update` checks the signature before handing the package to APT through sudo. A package on hold in APT is reported with how to release it.
+### New
-### Removed
+- `iphone-control update` checks for and installs the new stable release, through the script's service, Homebrew or the `.deb`. It asks first, and `--yes` skips the question (#51, #52).
+- Debian packages are signed, and the signature is checked before installing (#52).
-- `iphone-control update rollback` and the previous executable kept after an upgrade. A new version that doesn't start is still replaced by the old one automatically.
-- The rollback compatibility mark in release manifests: any newer signed stable release can be installed directly, without stopping at "manual migration required".
+### Fixes
-### Fixed
-
-- With the control page open in a browser that can't decode HEVC (Firefox, Chrome on most Linux) or on a device below iOS 27, WDA is no longer killed by iOS every 1–2 minutes: the picture is taken at full size and turned upright on the page in landscape, so WDA passes on the screenshot the phone encodes in hardware instead of scaling, rotating and re-encoding every frame, which took more CPU than iOS allows.
-- Piping output into a program that exits early, such as `iphone-control status | head -1`, no longer crashes with "Broken pipe"; the command ends quietly like other command-line tools.
-- Touches on the control page respond faster again: a press no longer measures the screen size on WDA each time (about 0.1–0.2 s, new in 0.2.2); the size is measured on rotation and at most once a minute. Moving the mouse over the picture also keeps the touch session open, so the first press after a pause doesn't wait about 0.5 s for it to reopen.
+- WDA is no longer killed every 1–2 minutes while the control page shows H.264 or MJPEG (#55).
+- Touches on the control page respond quickly again (#54).
+- `iphone-control status | head -1` and similar no longer crash with "Broken pipe" (#53).
## [0.2.2] - 2026-11-12
### Upgrade notes
-- For a new script installation, use the `install.sh` asset from your publisher's signed GitHub Release. It requires Python 3 and OpenSSL 3. To migrate an older script installation, stop the service and uninstall it with the original installer, then run the new installer. For 0.2.0, use the original publisher's script at the `v0.2.0` tag and pass `--uninstall` with your original prefix. Your settings and device data are kept.
+- New script installs use `install.sh` from the signed GitHub Release and need Python 3 and OpenSSL 3. To move an older script install, uninstall it with its own script first. Settings and device data are kept (#44).
-### Added
+### New
-- Check for host software updates with `iphone-control update check` or **About & updates** in the viewer. A red dot marks a newer stable release from the build's publisher. Open the panel to see the version and copy the upgrade command for your installation when available.
-- User services installed from a signed release can upgrade with `iphone-control update apply` and roll back with `iphone-control update rollback`. They check for updates by default. Opt in with `iphone-control update policy auto-patch` to install signed patches while idle and restore the previous version if the daemon fails its health check.
-- A redesigned control page: a workspace that fits wide and narrow windows, frosted panels (solid with high contrast or reduced transparency), and the task input, executor and settings together at the foot of the sidebar. Devices show their product name (iPhone 15 Pro rather than `iPhone16,1`) in an iPhone or iPad frame, and the status bar tells apart waiting for a device, connecting, view only, live and disconnected.
+- Update checks: `iphone-control update check`, or *About & updates* on the control page (#44).
+- Script installs upgrade with `update apply`, and can install signed patches automatically with `update policy auto-patch` (#44).
+- A redesigned control page that fits wide and narrow windows, with device names and frames (#45).
-### Fixed
+### Fixes
-- Taps, swipes and live touch from the control page are bound to the device and picture you see: after a device switch, a rotation or a lost picture they are refused instead of landing at the old position. A brief WDA hiccup no longer resets the picture or lifts a finger mid-drag, and WDA builds without `/rotation` read the orientation from SpringBoard.
-- Picture connections from closed or frozen tabs are released, so many reconnects no longer use up the control page's connections.
+- Taps and touches are refused after a device switch, rotation or lost picture, instead of landing in the wrong place (#45).
+- Closed or frozen tabs release their picture connections (#45).
## [0.2.1] - 2026-11-12
-### Added
+### New
-- On iOS 27 and later the control page shows the phone's own hardware-encoded video (the CoreDevice screen media stream, HEVC): about 60 frames a second at native resolution, nothing encoded on this machine and no capturing by WDA; the picture turns with the screen. Browsers that can't decode HEVC (Firefox, Chrome on most Linux machines) and older iOS fall back to H.264 or MJPEG. `IPHONE_CONTROL_VIEWER_CODEC=device` uses only this stream.
-- The control page shows the picture as H.264 at about 1/15 of the traffic: on macOS with VideoToolbox called directly (the JPEG decoded by the hardware too), no ffmpeg needed; on Linux with ffmpeg installed, GPU encoding first (NVENC, VAAPI, QSV, V4L2, else x264); on a slow link the frame rate drops instead of the picture falling further behind. Without ffmpeg it stays MJPEG, now without repeated frames. Settings: `IPHONE_CONTROL_VIEWER_CODEC`, `IPHONE_CONTROL_VIEWER_QP`.
-- Experimental `ICTL_WDA_DETACHED=1`: WebDriverAgent is launched in the background without an XCTest session, so it also starts while the phone is locked and keeps running when the daemon restarts. See [WDA dependency research](docs/dev/wda-dependency-research.md).
+- On iOS 27 and later, the control page shows the phone's own video: HEVC, about 60 fps, native resolution (#42).
+- Elsewhere the picture is H.264 at about 1/15 of the traffic, hardware-encoded where possible (#42).
+- Experimental `ICTL_WDA_DETACHED=1` launches WDA in the background, even while the phone is locked (#41).
-### Fixed
+### Fixes
-- With the control page open, WDA is no longer killed by iOS every few minutes (iOS 27 and later): capturing the picture took WDA over a CPU core, iOS kills a process averaging more than 80 % over a minute, and the daemon restarted WDA, failing actions meanwhile. With the phone's own video WDA stays around 3 %. Below iOS 27 the picture still comes from WDA; close the control page when you aren't watching.
+- On iOS 27 and later, WDA is no longer killed every few minutes while the control page is open (#42).
## [0.2.0] - 2026-11-11
### Upgrade notes
-- Docker is no longer released: no image on ghcr, no `compose.yaml`. Move to the one-line `install.sh`, Homebrew or the `.deb` (see Added). Stop the container first (`docker compose down`) so it doesn't hold the phone.
-- Your data was in the container's volume (`./data` next to `compose.yaml`, owned by root). Before the first run, copy it to `~/.local/share/iphone-control` and make it yours (`sudo cp -a ./data ~/.local/share/iphone-control && sudo chown -R "$(id -un)": ~/.local/share/iphone-control`; see [Data and backups](https://derrors.github.io/iphone-control/en/deploy/backup)) to keep the Apple ID session, the signed WebDriverAgent and auto-unlock passcodes. Pairing records now live with the system usbmuxd, so the phone may ask you to trust the computer again.
-- Settings move from `.env` to `~/.config/iphone-control/env` (same `KEY=value` lines; mode 0600). The first-run guide writes it, or copy your values over and run `iphone-control service restart`.
-- `ICTL_MANAGE_USBMUXD` and `ICTL_USBMUXD_BIN` are gone: the daemon no longer starts usbmuxd. On Linux install the system one (`sudo apt install usbmuxd`; the `.deb` depends on it), and unmask it if you masked it for the container (`sudo systemctl unmask usbmuxd`).
-- Register the MCP server again: the old `docker exec` registration no longer works. The first-run guide does it, or run the command `iphone-control mcp-config` prints.
-
-### Added
-
-- First-run guide: after installing, connect the phone and run `iphone-control`. The first time it walks you through setup in the terminal: language, proxy, the background service, pairing, Developer Mode, Apple ID, signing and installing WebDriverAgent, the optional auto-unlock passcode and notifications (Bark or Telegram, with a test message), and registering the MCP server with Claude Code and Codex. Steps already done are skipped; afterwards `iphone-control` shows the status and starts the service if it isn't running.
-- `iphone-control setup --reconfigure` redoes all of setup or one part: language, proxy, background service, Apple ID (sign in again and re-sign WebDriverAgent), phone, auto-unlock passcode, notifications or MCP registration.
-- `iphone-control service install|uninstall|start|stop|restart|status` manages the background service (launchd on macOS, a systemd user unit on Linux), whichever installed it: `install.sh`, `brew services` or the `.deb`.
-- Settings file `~/.config/iphone-control/env`: the service loads it, and so does every command (a variable already set in the environment wins). After editing it by hand, run `iphone-control service restart`.
-- `THIRD_PARTY_LICENSES.html` (licenses of all Rust dependencies) is in every release archive and in the `.deb`.
-- The control page follows the device the daemon controls: when it is switched elsewhere (another tab, `iphone-control select`, the MCP tool, or automatically after an unplug), the page notices within about 10 seconds, says so, and moves its picture and panels over. Actions carry the device the page shows and are refused, never sent to another phone, once the daemon controls a different one.
-- The control page says why a device has no picture (not connected, needs pairing or Developer Mode, WebDriverAgent starting or why it failed to start, needs unlocking), and offers a "Sign and install WDA" button for a device without WebDriverAgent when an Apple ID is signed in.
-- Recovery from a revoked signing certificate: a free Apple ID holds at most two certificates, and signing with it somewhere else (another machine, moving from Docker to a native install, another sideloading tool) creates one and revokes an old one, after which WDA signed with that certificate won't start on any device although its profile still looks valid. When a device now refuses to start WDA, the daemon checks whether that WDA was signed with this machine's certificate and whether this machine's certificate is still in the Apple ID's team, and re-signs the device automatically if not (at most once per device every 6 hours).
-- `doctor` shows both certificate checks; signing that creates or revokes a certificate is logged and notified (a new notification type `cert`, try it with `notify-test cert`).
-- Simpler installs: `curl -fsSL https://raw.githubusercontent.com/Derrors/iphone-control/main/install.sh | sh` on macOS (Apple Silicon) and Linux installs the release binary and runs the daemon as a per-user service (launchd on macOS, which had none before; systemd on Linux), and upgrades or uninstalls it again; `brew install derrors/tap/iphone-control` with `brew services start iphone-control`; and a `.deb` for Debian 12+ and Ubuntu 22.04+ (amd64, arm64) with a systemd user service, depending on usbmuxd. The release workflow builds the packages and updates the Homebrew tap.
-- AI tasks in the live viewer: type a task on the page and a local agent (Claude Code or Codex, picked on the page) carries it out on the phone through the MCP tools, while the page shows each step with what the agent says it is doing, the result and screenshots, and marks where it taps. Pause, resume, take over (act on the phone yourself) and hand back, or stop. Before paying, deleting, sending a message or changing account settings the agent asks on the page (`iphone_confirm`) and waits; a rejected step isn't done. The steps, holds and confirmations go through `iphone-control mcp` itself, so they work the same with either agent; the agent runs with only the phone tools (no shell or file tools for Claude Code, a read-only sandbox for Codex).
-
-### Changed
-
-- New viewer page: AI assistant, live screen with zoom, and a device panel with state and readiness checks, installed apps (launch, quit, open a URL) and on-screen elements (highlight on the picture, tap by name, wait for text). The device can be switched from the page, and the picture follows. While an AI task runs, manual actions are refused until you take over.
-- On iOS 27 and later the viewer's picture works like a touchscreen: pressing, moving and releasing the mouse moves a finger on the phone as you go (over CoreDevice HID), so a list scrolls while you drag, and the mouse wheel or trackpad scrolls the page under the pointer without holding the button. A tap round trip is about 20 ms instead of about 530 ms, and a drag no longer waits for the list to stop (1.8 to 3 s before). Older iOS versions keep whole gestures sent on release. While the viewer is used, the HID session's screen stream keeps the phone awake, until 30 seconds after the last touch.
-- The live picture runs at about 50 frames a second at 75% size (WDA's default was 10 at full size).
-- The viewer page is in English or Chinese: it follows `IPHONE_CONTROL_LANG`, and a button switches it. The daemon's messages and the AI task (instructions, tool results) use the page's language.
-- The viewer's task history shows one plain sentence per step (what the agent said it is doing, or a description of the action), without screenshots, tool names, parameters or raw results; a step that didn't work says so. Screenshots are no longer passed from the agent's tools to the viewer.
-- The viewer no longer draws marks for your own taps and swipes, and no longer shows a message for each successful manual action; errors are still shown.
-- The viewer serves more read-only JSON (`/api/daemon`, `/status`, `/devices`, `/apps`, `/elements`) and refuses reads that a browser marks as sent by another site (`Sec-Fetch-Site`), since reading elements can unlock the phone.
-
-### Removed
-
-- The Docker image (`ghcr.io/derrors/iphone-control`), `compose.yaml`, `docker/Dockerfile` and `.dockerignore`. A container can't reach the local Claude Code or Codex that the control page hands tasks to, and the native installs are simpler.
-- The daemon no longer starts or watches usbmuxd (`ICTL_MANAGE_USBMUXD`, `ICTL_USBMUXD_BIN`); the system usbmuxd is used on Linux and macOS.
-- `deploy/iphone-control.service`: `install.sh` and `iphone-control service install` write the unit now.
-- `iphone-control mcp-config --container`: `mcp-config` takes no arguments and prints a path that survives Homebrew upgrades.
-
-### Fixed
-
-- Control page: the mouse wheel works again on devices below iOS 27 (whole-gesture mode). It waited for a leftover scroll amount that never drains in that mode, so no swipe went out and later wheel events piled up.
-- Pressing Home right after an app comes to the front, while its transition is still running, was ignored by iPadOS for both ways of pressing (about one time in three on an iPad mini 5 / iPadOS 26.6.1). When neither brings back the home screen, Home is now pressed once more.
-- When WebDriverAgent fails to start with only `unexpected response`, the hint adds the second likely cause: if the developer is already trusted, the signing certificate may have changed; run `iphone-control sign` to re-sign the device. In that case the control page offers a "Re-sign and install WDA" button when an Apple ID is signed in.
-- In automatic mode the daemon, after a restart, goes on with the last device that was ready instead of whichever usbmuxd lists first (with an iPhone and an iPad connected, a restart could switch to a device whose WebDriverAgent can't start).
-- `iphone-control viewer` no longer exits when the daemon isn't up yet and several devices are connected: it starts anyway and the page follows once the daemon has picked a device.
-- Control page: on a device below iOS 27 without WebDriverAgent, the route shows "Unavailable" instead of the HID fallback (which needs iOS 27); an unknown lock state is no longer shown as "Unlocked"; when WebDriverAgent fails to start, the picture area shows why instead of "usually 10–60 seconds".
-- "WDA failed to start: WDA failed to start:" is no longer doubled in the log and the state.
-- `devices`, `select` and `doctor` on the command line also name `iphone-control select` / `iphone-control status`, not only the MCP tools; when the daemon can't be reached, the hint is `iphone-control service start`.
-- `lock` no longer takes about 10 seconds on newer iPhones: the power key is pressed for 0.1 s instead of held for 0.5 s, which an iPhone 18 Pro Max (iOS 27.2.1) ignored, so every lock fell through to WebDriverAgent's slower lock and logged a timeout.
-- `home` takes about 1.3 seconds instead of 3.7 on devices that ignore the IOHID Home event (iPhone 18 Pro Max, iOS 27.2.1): when only the XCTest press works, the daemon remembers that for the device and uses it first. Devices where only the IOHID press works (iPhone 12 mini) keep their order.
-- Taps and long presses no longer take about 26 seconds while something on screen keeps animating (seen tapping a search result in Settings with the keyboard up, iPhone 18 Pro Max, iOS 27.2.1): like swipes, they no longer wait for WebDriverAgent's animation cool-off. The result came back in about 1.4 seconds.
-- `iphone_web_targets` and `iphone_web_eval` say to turn on Settings → Safari → Advanced → Web Inspector when the phone closes the connection, instead of only showing a TLS error.
-- `iphone_app_logs` no longer returns Info lines, matching its description (some processes still send them on a stream without debug messages).
-- English device descriptions have a space before the parenthesis and after the comma: `name (model iOS version, UDID)`.
+- Docker is no longer released. Stop the container (`docker compose down`) and move to `install.sh`, Homebrew or the `.deb`.
+- To keep the Apple ID session, signed WDA and passcodes, copy the container's `./data` to `~/.local/share/iphone-control` first ([how](https://derrors.github.io/iphone-control/en/deploy/backup)). The phone may ask to trust the computer again.
+- Settings move from `.env` to `~/.config/iphone-control/env`.
+- The daemon no longer runs usbmuxd. On Linux, install the system one (`sudo apt install usbmuxd`), and unmask it if you masked it for the container.
+- Register the MCP server again: the first-run guide does it, or run the command `iphone-control mcp-config` prints.
-## [0.1.5] - 2026-11-10
+### New
-### Added
+- One-line installs: `install.sh` for macOS (Apple Silicon) and Linux, Homebrew, and a `.deb` for Debian 12+ / Ubuntu 22.04+, each with a background service.
+- First-run guide: run `iphone-control` after installing. `setup --reconfigure` redoes any part of it.
+- `iphone-control service install|uninstall|start|stop|restart|status`.
+- AI tasks on the control page: type a task and Claude Code or Codex does it on the phone. Pause, take over or stop it at any time, and it asks before paying, deleting or sending.
+- A revoked signing certificate is detected and the device re-signed automatically.
+- The control page follows device switches, explains why there is no picture, and can sign and install WDA.
-- English: `IPHONE_CONTROL_LANG=en` switches tool descriptions and results, CLI output and help, `status`/`doctor`, logs and notifications to English. The default stays Simplified Chinese, and older clients still get Chinese.
-- `iphone-control viewer [--port]`: watch and control the phone live in a browser (opt-in, 127.0.0.1:8200 by default). Other local users can reach the port, so stop it when done.
-- Developer tools, opt-in with `IPHONE_CONTROL_DEV_TOOLS=1`: `iphone_app_logs`, `iphone_crash_reports`, `iphone_install_app`, `iphone_uninstall_app`, `iphone_web_targets` and `iphone_web_eval`. Without the switch the tool list is unchanged.
+### Improvements
-### Fixed
+- New control page: AI assistant, live screen with zoom, and a device panel with apps and elements. In English or Chinese.
+- On iOS 27 and later the picture works like a touchscreen: about 20 ms per tap instead of 530 ms.
+- The picture runs at about 50 fps.
-- Scroll bars are dropped from element lists in every system language, not only Chinese and English.
-- `iphone_uninstall_app` only accepts a bundle ID or the full display name; empty, partial or ambiguous names are refused and the candidates are listed.
-- App installs and re-signing wait for each other instead of uploading to the phone at the same time.
-- A daemon that gets stuck exits by itself, so systemd or Docker can restart it.
-- Memory no longer grows while the HID fallback is in use.
-- `usbmuxd.log` is rotated when it gets too large.
+### Fixes
-## [0.1.4] - 2026-11-07
+- The mouse wheel works again on the control page below iOS 27.
+- `lock` and `home` are much faster on newer iPhones, and taps no longer take 26 s while something animates.
+- Home pressed during an app transition on iPad is retried.
+- After a restart, the daemon goes on with the last device that was ready.
+- `iphone-control viewer` starts even before the daemon has picked a device.
+- Clearer hints when WDA fails with `unexpected response`, Web Inspector is off, or the daemon can't be reached.
+- `iphone_app_logs` no longer returns Info lines.
-### Security
+## [0.1.5] - 2026-11-10
+
+### New
-- Updated the `zip` crate to 9.4.1 (from 8.6.0, and 2.6.1 in the vendored apple-codesign) for GHSA-m665-v7pm-7grj, GHSA-q7v9-x93c-xqv3, GHSA-hjqx-j4rw-g7xv, GHSA-9hj8-73fh-9963 and GHSA-8hxf-qr8p-62x4. iphone-control only unpacks the checksum-verified WebDriverAgent package from Appium, so the practical exposure was small.
-- The documentation site's build tooling uses vite 6.4.5 and esbuild 0.25 (development dependencies only; the published site was not affected).
+- English: `IPHONE_CONTROL_LANG=en` for tools, CLI, logs and notifications.
+- `iphone-control viewer`: watch and control the phone in a browser.
+- Developer tools, with `IPHONE_CONTROL_DEV_TOOLS=1`: app logs, crash reports, installing and uninstalling apps, and Safari's Web Inspector.
-### Changed
+### Fixes
-- `ICTL_DDI_DIR` (a Developer Disk Image directory you extracted yourself) is never downloaded into or deleted from; missing files are reported by name. Only the default `ddi/` cache is cleared and downloaded again, and only after three failed *mounts* (tunnel errors no longer count).
-- The `debug` subcommands are no longer built by default; build with `--features debug-cmds` to get them.
-- Tool descriptions say that screenshots, `iphone_list_elements` and `iphone_wait_for` also unlock the phone when auto-unlock is configured, and that the HID fallback needs iOS 27.
+- Scroll bars are left out of element lists in every language.
+- `iphone_uninstall_app` refuses partial or ambiguous names.
+- App installs and re-signing no longer upload at the same time.
+- A stuck daemon exits so its service restarts it.
+- Memory no longer grows with the HID fallback, and `usbmuxd.log` is rotated.
+
+## [0.1.4] - 2026-11-07
-### Fixed
+### Improvements
-- An action whose WebDriverAgent request was sent but whose connection then dropped, or whose response was incomplete, is no longer repeated over HID (a tap or text could happen twice). It now reports that the phone may already have done it.
-- Calls to usbmuxd, lockdown, AMFI, misagent and installation_proxy have time limits, so a phone or usbmuxd that accepts a connection but never answers can no longer hang the daemon.
-- Re-signing has an overall time limit (15 minutes) instead of staying "in progress" forever when Apple's servers or the install stall, and the Apple ID session check has one too. After the phone reconnects or another device is selected, re-signing is checked within a minute instead of waiting up to `RESIGN_CHECK_HOURS`. Finishing a re-sign for one device no longer tears down the session of a device selected meanwhile.
-- When the phone is locked before its first unlock and WDA can't start, `status` keeps showing that the phone needs unlocking and retries every 20 seconds, instead of flipping back to "starting" and retrying every 10 seconds.
-- A HID session that timed out while opening no longer leaves the screen media stream running on the phone (no auto-lock, icon stuck in the Dynamic Island).
-- Cancelling an MCP call stops it: the remaining `iphone_batch` steps don't run, and a request still waiting for the device is dropped.
-- `iphone_batch` stops if the controlled device changes while it runs (for example, the device is unplugged and another one is picked automatically).
-- A newly started WebDriverAgent is only considered ready after its test plan has started, so a stale WDA still answering on the phone can't make it look ready early.
-- `doctor` counts only iPhones, iPads and iPods as phones on USB; an Apple keyboard no longer passes the check.
-- The system-alert check after an action is no longer skipped when the tapped element's text happens to contain the words "系统弹窗".
-- Auto-unlock now also recognizes leftover WDA wait settings from an interrupted swipe or poll and restores the defaults.
-- iPad: when WebDriverAgent was started while the iPad was locked, it keeps reporting "not locked", and a dark Touch ID lock screen with notifications has no lock marker in the element tree. Auto-unlock used to trust WDA from then on and never unlock; such an ambiguous screen is now treated as possibly locked (unlocked automatically when a passcode is set, shown as "possibly locked" in `status`).
-- iPad: rows in the floating sidebar of iPadOS 26 apps such as Settings can be tapped by name again; the empty sidebar-sized containers behind the list were mistaken for something covering it.
-- When WDA drops between two health checks, errors say it just dropped instead of showing the state as "ready".
+- `ICTL_DDI_DIR` is never written to; only the default cache is downloaded again after three failed mounts.
+- `debug` subcommands need `--features debug-cmds`.
+
+### Fixes
+
+- Security: `zip` updated to 9.4.1 for GHSA-m665-v7pm-7grj and related advisories. Exposure was small.
+- An action whose connection dropped is no longer repeated over HID.
+- Calls to the phone, usbmuxd and Apple have time limits, so the daemon can't hang on them.
+- Re-signing is checked within a minute after reconnecting or switching devices.
+- Cancelling an MCP call stops it, including the rest of an `iphone_batch`. A batch also stops if the device changes.
+- A timed-out HID session no longer leaves the screen stream running.
+- A stale WDA can't look ready early, and errors say when WDA just dropped.
+- iPad: auto-unlock works when WDA was started while locked, and sidebar rows can be tapped by name again.
+- `doctor` no longer counts an Apple keyboard as a phone.
## [0.1.3] - 2026-11-07
### Upgrade notes
-- Auto-unlock passcodes now belong to individual devices. Before upgrading, ensure the only connected device is the one whose passcode was saved by the old version; that legacy passcode is automatically assigned when exactly one device is connected. If its owner is uncertain, clear it with the old version's `passcode clear` before upgrading, then use `passcode set --device <UDID>` for each device. Back up the data directory first.
-- Device selection is shared by all clients. Explicit `select` choices survive daemon restarts; automatic selection keeps the current device only while the daemon runs and it remains connected.
-- Landscape HID fallback needs a matching WDA rotation sample no older than 30 seconds. Do not flip the device between landscape sides while WDA is unavailable; wait for WDA to recover before doing so.
+- Auto-unlock passcodes are now per device. Before upgrading, connect only the device whose passcode was saved, or clear it and set each one with `passcode set --device <UDID>`.
+- Device selection is shared by all clients, and `select` choices survive restarts.
+- In landscape without WDA, don't turn the device to the other landscape side.
-### Added
+### New
-- Choose which device to control when several iPhones/iPads are connected: new MCP tools `iphone_list_devices` and `iphone_select_device`, commands `devices` and `select`. The choice is saved in state.json and survives restarts; `select auto` goes back to automatic choice. `IPHONE_UDID`, when set, wins and switching is refused.
-- Auto-unlock passcodes are kept per device (`secrets/passcodes/<UDID>`); `passcode set/clear` accept `--device`. A passcode saved by an older version is assigned to the device when exactly one is connected over USB, and isn't used while several are.
+- Choose which device to control: `iphone_list_devices` and `iphone_select_device`, or `devices` and `select`.
+- Auto-unlock passcodes per device.
-### Fixed
+### Fixes
-- Screen dimensions now follow rotation, preventing stretched screenshots and filtered-out elements near the bottom. iPad landscape system UI coordinates are converted to screen coordinates, using the status bar position to distinguish the two landscape directions.
-- Auto-unlock on Touch ID devices now taps “Use Passcode” first; lock-screen detection and iPad delete-key positioning are handled, with numeric keypad layout validation before typing.
-- Read the current device's installed WDA provisioning profiles via misagent for `doctor`, `status` and automatic re-signing, rather than relying on another device's last signing record.
-- `setup` waits for the daemon to recognise the target device before signing and installing. Offline and pre-iOS-27 diagnostics are corrected; generic WDA launch errors include a first-install developer-trust troubleshooting hint.
-- `open_url` waits for a stable foreground app, reducing cold-start black screenshots and transient system services being reported as the target app.
-- HID fallback taps and swipes now map landscape coordinates back to the device's native portrait coordinate system. Saved dimensions and reused HID sessions are normalized to portrait. Every fallback touch checks a fresh screenshot; landscape touches need a matching WDA rotation sample no older than 30 seconds and are refused when it is unavailable, including after a daemon restart. Do not flip the device between landscape sides while WDA is unavailable: screenshot dimensions alone cannot detect a 180° change.
-- Without `IPHONE_UDID` and with several devices connected, a change in usbmuxd's list order silently switched control to another device (auto-unlock could type one device's passcode into another). The controlled device is now kept until it disconnects.
-- With `IPHONE_UDID` set to a device that isn't connected while another one is, usbmuxd was restarted every 30 seconds.
-- In the container, a second device plugged in while one was already connected was never picked up by usbmuxd (no udev, so no hotplug events), and usbmuxd wasn't restarted. The number of iPhones/iPads on USB is now compared with the number usbmuxd sees.
-- After switching devices, the previous device's app list cache and screen size were still used.
+- Screen size follows rotation: no stretched screenshots or missing elements, and iPad landscape coordinates are right.
+- HID fallback taps and swipes work in landscape, and are refused when the orientation is unknown.
+- Auto-unlock on Touch ID devices taps "Use Passcode" first and checks the keypad.
+- Control no longer jumps to another device when usbmuxd reorders its list.
+- `doctor`, `status` and re-signing read the current device's own WDA profiles.
+- `setup` waits for the device before signing, and `open_url` waits for the app before returning.
+- Switching devices no longer reuses the previous device's app list and screen size.
+- usbmuxd is no longer restarted every 30 s for a missing `IPHONE_UDID`, and a second device is picked up in the container.
## [0.1.2] - 2026-11-04
-### Added
+### New
-- Prebuilt macOS binary (Apple Silicon, macOS 11+) in Releases: `iphone-control-vX.Y.Z-macos-arm64.tar.gz`. It isn't notarized; see the macOS guide if Gatekeeper blocks it.
+- Prebuilt macOS binary (Apple Silicon, macOS 11+). It isn't notarized; see the macOS guide.
## [0.1.1] - 2026-11-04
-### Added
+### New
-- macOS (Apple Silicon) support: build from source and run as a regular user with the system usbmuxd; no Xcode needed. See the new macOS guide.
+- macOS (Apple Silicon) support, no Xcode needed.
-### Changed
+### Improvements
-- MCP tool descriptions now explain when to use each tool, what it returns and how it behaves; every parameter is documented and every tool carries MCP annotations. Tool names, parameters and results are unchanged.
-- Release binaries are named `iphone-control-vX.Y.Z-linux-<arch>.tar.gz`.
+- Tool descriptions explain when to use each tool and what it returns.
+- Release files are named `iphone-control-vX.Y.Z-linux-<arch>.tar.gz`.
-### Fixed
+### Fixes
-- `home` and `lock` had no effect on some phones (seen on an iPhone 12 mini, iOS 26.4.1), and auto-unlock couldn't wake a dark screen there.
-- After a disconnect of a few seconds, setups using the system usbmuxd (macOS, Linux source installs) got stuck on "bad device"; they now reconnect by themselves.
-- `doctor` on macOS no longer reports "no Apple device on USB", and its hints use macOS commands.
-- When auto-unlock can't bring up the passcode keypad, the message mentions StandBy, which hides the keypad.
+- `home`, `lock` and waking for auto-unlock work on phones such as the iPhone 12 mini.
+- Setups using the system usbmuxd reconnect after a short disconnect.
+- `doctor` works on macOS.
## [0.1.0] - 2026-11-02
First public release.
-### Added
-
-- `iphone-control daemon`: one long-running process owns the phone — usbmuxd supervision (with a sysfs fallback for containers without udev), pairing and Developer Mode checks, Developer Disk Image download and mounting, a CoreDevice tunnel with a user-space TCP stack, WebDriverAgent launch and health checks, and a state machine that recovers from unplugging, usbmuxd restarts and phone reboots.
-- MCP server with 15 tools: status, screenshots with zoom-in regions, element lists, tap / tap by text, long press, swipe, typing (including Chinese), hardware buttons, app launch / terminate / list, URLs, `iphone_wait_for` and `iphone_batch`. Action tools accept `then` to return the screen after the action.
-- HID fallback for taps, swipes, buttons, ASCII typing and screenshots while WebDriverAgent is unavailable.
-- Signing of WebDriverAgent with a free Apple ID (two-factor and SMS login), including the `.xctest` bundle, a post-signing check, automatic re-signing before the 7-day profile expires, and a daily Apple ID session check.
-- Notifications through Bark and Telegram, with de-duplication.
-- Optional auto-unlock with strict safeguards (stops after one wrong attempt).
-- `setup` wizard, `doctor` diagnostics, `status`, `mcp-config`, `wda-bridge`, `notify-test`.
-- Docker image (single binary plus Debian's usbmuxd, not privileged) with a generated third-party license list, published to `ghcr.io/derrors/iphone-control` for linux/amd64 and linux/arm64.
-- Running without Docker, from source or from the prebuilt Linux binaries (x86_64, aarch64): as a regular user with the system usbmuxd, XDG data and socket paths, the unsigned WebDriverAgent downloaded and checksum-verified before the first signing, `mcp-config` printing a direct command, and a systemd user service.
+### New
+
+- A daemon that owns the phone: pairing, Developer Mode, disk image, tunnel and WebDriverAgent, recovering from unplugging and reboots.
+- MCP server with 15 tools: screenshots, elements, taps, swipes, typing (Chinese too), buttons, apps, URLs, waiting and batches.
+- HID fallback while WDA is down.
+- WDA signed with a free Apple ID and re-signed before it expires.
+- Bark and Telegram notifications, and optional auto-unlock.
+- `setup`, `doctor`, `status` and `mcp-config`.
+- Docker image and prebuilt Linux binaries.
[Unreleased]: https://github.com/Derrors/iphone-control/compare/v0.2.6...HEAD
[0.2.6]: https://github.com/Derrors/iphone-control/compare/v0.2.5...v0.2.6
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 511e18e..2ed50ca 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -2,351 +2,298 @@
[English](CHANGELOG.md) | **简体中文**
-格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循[语义化版本](https://semver.org/lang/zh-CN/)(0.x 期间次版本号也可能有不兼容的变化)。和 [CHANGELOG.md](CHANGELOG.md) 一一对应,发布说明从这两个文件里取。
+每个版本改了什么,一行一条。版本号遵循[语义化版本](https://semver.org/lang/zh-CN/);0.x 期间次版本号也可能有不兼容的变化,升级前先看「升级注意事项」。和 [CHANGELOG.md](CHANGELOG.md) 一一对应,发布说明从这两个文件里取。
## [Unreleased]
-### 新增
+### 升级注意事项
+
+- iOS 27 及以上的手机改用原生控制。想继续用 WebDriverAgent,在 `~/.config/iphone-control/env` 里设 `ICTL_IOS_BACKEND=wda`(#123)。
+- 从源码编译需要 Rust 1.89(#119)。
-- iOS 27 起的手机默认不用 WebDriverAgent(原生控制):不登录 Apple ID、不签名、不装 WDA,守护进程只挂开发者镜像、连上无障碍服务(remoteAXService)就就绪,通常几秒。读界面逐个元素向无障碍服务读(类型、文字、值、id、位置和 WDA 的一致,按名字点击、遮挡判断、系统弹窗、通知横幅照常),点击、滑动、长按、按键和 Home 经 HID,输入文字一律走剪贴板粘贴:自动点「允许粘贴」、读回输入框核对后马上还原剪贴板。启动 App、打开链接经 CoreDevice,结束 App 发 SIGKILL,锁屏状态问 lockdown;自动解锁的规则和经 WDA 时一样。按 Home 没回到主屏幕时改从屏幕底部上滑。`iphone-control setup` 对这样的手机跳过 Apple ID 和签名;`status`、`doctor` 和控制台显示「原生」。要改回 WDA,在 `~/.config/iphone-control/env` 里设 `ICTL_IOS_BACKEND=wda`。已经装着的 WDA 留着,照常自动重签。iOS 26 及以下不变。之前用 WDA 时后台启动(`ICTL_WDA_DETACHED`)的 WDA,在准备手机时会被结束(CoreDevice AppService 发 SIGKILL,DVT 的 `kill_app` 结束不了 WDA)。
-- WebDriverAgent 不可用时,`iphone_type_text` 也能输入中文等美式键盘按不出来的文字:经 HID 把它写进手机剪贴板(CoreDevice `pasteboardservice`,写完读回核对),再按 Cmd-V,输入法不会把它当成拼音。iOS 把这段文字当成别的 App 的,每次都会问「…想从“dtpasteboardd”粘贴」(iPhone 15 Pro Max、iOS 27.2.1 的备忘录实测);结果里会提示截图后点「允许粘贴」。剪贴板一改这个弹窗就消失,所以原来的内容 45 秒后才写回(下一次这样粘贴前、换设备时也会写回),而且只在剪贴板里还是粘贴的那段文字时才写。带 `submit` 时不按回车:弹窗还在时回车会选中「不允许粘贴」。英文和符号仍然逐键输入,不动剪贴板。
-- 带 `then` 的操作会说明界面变没变:界面稳定后,和操作前刚读过的界面(元素列表、截图,或按名字点击之前读的元素树)比较。没变时提醒操作可能没生效、先看清再决定要不要重做。上一个操作之后没看过界面就不说。真机(iPhone 15 Pro Max、iOS 27.2.1 的设置):点空白处说「一样」,打开「通用」、点返回都说「有变化」。
+### 新功能
-### 变更
+- iOS 27 及以上不再需要 WebDriverAgent:不用 Apple ID、不用签名,几秒就绪。iOS 26 及以下不变(#123)。
+- WebDriverAgent 不可用时也能输入中文等非 ASCII 文字,手机询问时点「允许粘贴」(#118)。
+- 带 `then` 的操作会说明界面变没变,Agent 能看出点击没生效(#121)。
-- 守护进程总在后台启动 WDA、不再持有 XCTest 会话:手机锁着也能启动 WDA,守护进程重启、升级时 WDA 不中断,切换设备再切回来直接接上。原来的实验开关 `ICTL_WDA_DETACHED` 去掉了,设置文件里留着也不起作用(`=0` 也不能改回原来的方式)。`iphone-control service stop`、`service uninstall` 会结束它。见 docs/decisions.md D18。
-- 从源码编译需要 Rust 1.89(原来 1.88),因为 uuid 1.29 要求它。
-- 依赖升级:rmcp 3.10.0、rcgen 0.14.10、console 0.16.6、sha2 0.11.1、uuid 1.29.2、zip 9.5.1、flate2 1.1.11,以及 26 个间接依赖的兼容版本(rustls-webpki、mio、openssl、webpki-roots 等)。rcgen 只用 ring(它默认还会编 aws-lc)。vendor 里的 plume_core 生成签名请求改用 rcgen 0.14、apple-codesign 改用 dialoguer 0.12,rcgen 和 console 各只编一份,不再两个版本并存。x509-certificate 留在 0.24、rsa 留在 0.9:apple-codesign 和它的依赖用的是这两个版本,我们升了只会在旁边多编一份。控制台自己生成的 HTTPS 证书仍是 ECDSA P-256,以前生成的照常能用。
-- CI:actions/setup-node 7、dorny/paths-filter 4。网站:vue 3.5.45。
+### 改进
+
+- 依赖升级(#119)。
### 修复
-- 开着后台启动 WDA(`ICTL_WDA_DETACHED`)时:`iphone-control service stop`、`service uninstall` 停掉服务后,会结束接着的手机上后台启动的 WDA,不再让它一直留在手机上(`service restart` 和升级照旧不打断它);切换设备时每台手机的后台 WDA 各记一条,切回去直接接上,不再重新启动。
-- 引导(`iphone-control setup`)菜单里的方向键在机器很忙时可能变成字母:读按键读到一半,程序被挂起超过 250 毫秒,后面已经到了的字节会被丢掉,最后一个当成输入的字符(↓ 变成「B」)。现在已经收到的字节一定会读。
-- 隔了一分钟以上的点按、滑动不再先等重新读屏幕尺寸:iPad mini 5(iPadOS 26.7.3)上 WDA 读一次要 0.95 秒,停一会儿后的第一次点按要 1.7 秒,平时 0.9 秒。尺寸现在在没人操作时于后台重读(只有「显示缩放」会改变它),转屏时照旧马上重读。
-- 控制台页面的 H.264 或手机自己的视频 9 秒内没出第一帧时(控制台服务或守护进程正在重启、编码器正在启动),原来一直用 MJPEG 直到刷新页面;现在 30 秒、1 分钟、2 分钟后各再试一次。控制台服务明确说不可用的画面仍然不再试。
-- 控制台上经 WDA 的滑动不再等列表停下才返回(原来要反复读元素树,最多 2.5 秒):页面前的人看得见。iPad mini 5 上一次滑动从 3.1 秒降到 1.6–2.3 秒。Agent(MCP、命令行)仍然等,免得下一次点击落在还在滚的列表上。
-- 每台设备按 Home 和锁屏该用哪种方式,现在记在 `state.json` 里,不再只放在内存。原来守护进程重启或中途控制过别的设备后,在 IOHID 的 Home 不起作用的设备上,第一次按 Home 会先用 IOHID 按,等 2 秒没回到主屏幕再补按一次:iPad mini 5 上要 4.4 秒,平时 0.8 秒。
-- WebDriverAgent 没有及时应答的点击、滑动、按键、启动 App,不会再过一阵才执行。WDA 一个一个处理请求,我们不等了它还会接着做,排在慢请求后面的动作可能在报了失败之后很久才落到屏幕上。现在守护进程马上结束那个 WDA 会话(`DELETE /session`:WDA 16.15.3 不排队处理它,还会丢掉这个会话里还在排队的请求),下一个动作开新会话。读超时不结束会话。
-- 元素特别多的界面(很长的信息流、列表)读元素树不再一直那么慢。一次读超过 8 秒或超时,下一次就让 WDA 少读一些(先限每个元素最多 150 个子元素,再把层数和子元素数减半,最少 12 层、60 个);读得快于 1.5 秒就放宽一级。元素树被截短时,`iphone_list_elements` 和没找到元素的 `iphone_tap_element` 会说明。
-- 屏幕顶上弹着通知横幅时,按名字点击、读元素、`then=elements` 读到的是 SpringBoard 的元素树而不是 App 的(真机上弹着「Device Hub」横幅时,备忘录里的按钮找不到)。WDA 看屏幕上一个点下面是谁来判断前台 App,这个点默认在离左上角短边 20% 处,430 点宽的 iPhone 上是 (86, 86),正在横幅底下。现在每次 WDA 启动后挪到离左上角短边一半处,即 (215, 215)。
-- HID 后备路线的粘贴(WebDriverAgent 不可用时输入中文等)写手机剪贴板时只写本机。原来写入不带来源信息(`sourceMetadata`),手机的剪贴板服务会把它经「通用剪贴板」提供给机主的其他苹果设备,粘贴的文字和之后写回的原内容都可能覆盖 Mac 上的剪贴板(依据 Pinky 对这个服务的记录,这里没在 Mac 上核对)。现在写入时和 Xcode 一样带上来源信息。备忘录里照样会问「允许粘贴」。
+- `service stop`、`service uninstall` 也会结束后台启动的 WDA,每台手机各用各的(#124)。
+- 粘贴到手机上的文字不再经「通用剪贴板」传到 Mac(#122)。
+- 弹着通知横幅时,读到的是 App 的元素,不再是横幅的(#121)。
+- 机器很忙时,引导菜单里的方向键不再变成字母(#120)。
+- WDA 没及时应答的点击、按键,不会过一阵又落到屏幕上(#118)。
+- 元素特别多的界面读得更快,列表被截短时会说明(#118)。
+- 停一会儿后的第一次点按不再等重新读屏幕尺寸(#110)。
+- 控制台的 H.264 或手机视频启动慢时会再试,不再一直停在 MJPEG(#109)。
+- 控制台上的滑动返回更快(#108)。
+- 守护进程重启后,部分设备第一次按 Home 不再慢(#107)。
## [0.2.6] - 2026-11-14
-### 新增
+### 新功能
-- 控制台画面的弱网模式:「设置」里的开关,适合外网或信号差时用。手机自己的视频(HEVC)按 2 Mbit/s 的码率上限向手机要(原来 6),流量约减一半,帧率不变(iPhone 主屏幕上滑动时 214 KB/s,原来 459–483);画面静止时看不出区别,动起来时会有些糊块。每台手机只有一路这样的流,所以只要有一个在看它的页面开着,所有页面都一起降;第一个这样的页面来、最后一个走时流会重新开始(画面断开半秒左右)。H.264 只影响开它的页面(qp 26:689 KB/s,原来 1350)。
+- 控制台画面的弱网模式,在「设置」里打开,流量约减一半(#104、#105)。
-### 变更
+### 改进
-- 控制台页面的请求共用连接(`Connection: keep-alive`),不再每个请求都新开一条。Wi-Fi 下新连接加 TLS 握手要多两个往返,每次点按、每次查询、画面每秒十次回报都要付出这个代价。往返 40 毫秒时,页面的一个请求从约 220 毫秒降到 47 毫秒,页面开约 40 秒建的连接从 763 条降到 19 条。只有登录过的请求才保持连接,空闲 15 秒关闭,32 个名额剩不到 8 个时也不保持;画面、任务事件、`/mcp` 这些流仍各用自己的连接。
+- 控制台复用连接,Wi-Fi 下点按和查询的响应快了好几倍(#103)。
### 修复
-- 手机的屏幕媒体流停下又重新开始时,正在看手机自己视频的控制台页面再也收不到画面,也不会断开(守护进程那边每个页面都握着流的通道,它关不掉);现在页面会知道流结束了并重新连接。
-- 控制台上按 Home 立即按下:iPhone 主屏幕上从约 1 秒降到约 0.5 秒。守护进程原来先查一遍有没有挡住 Home 的系统弹窗(主屏幕上要 0.8 秒),而页面前的人本来就看得见;现在页面的请求会注明有人在看(`watched`),守护进程只在按下后没回到主屏幕时才去查。Agent(MCP、命令行)仍和原来一样先查。
-- 控制台上的点按和按 Home 不再排在页面的后台查询后面。显示手机自己的画面时,页面每隔几秒查一次有没有系统弹窗,在主屏幕上这一下要占用 WDA 约 0.8 秒,状态查询也要占用手机,期间来的操作只能等着。现在这些查询会让路:操作后 4 秒内(状态查询 1 秒内)不查,有操作在排队时不开始,查到一半来了操作就放弃。页面在查询时,手指按下的 P90 从 775 毫秒降到 25 毫秒,按 Home 从 1.8 秒降到 1.3 秒。
-- 控制台上手机自己的画面(HEVC)在 Wi-Fi 下不再时不时卡住半秒到一秒。页面的一次回报晚到几百毫秒,画面就会丢到下一个关键帧;现在这种情况下帧会先等最多 400 毫秒,允许的延迟也跟着链路往返的波动走,页面同时最多有两个回报在路上(原来一个)。模拟 Wi-Fi 延迟时,最长卡顿从 1.1 秒降到 0.1 秒。
+- 控制台上手机自己的视频在 Wi-Fi 下不再卡顿(#100)。
+- 控制台的点按和 Home 不再排在页面的后台查询后面(#101)。
+- 控制台上按 Home 的响应时间约减一半(#102)。
+- 手机重开屏幕媒体流后,控制台会重新接上画面(#104)。
## [0.2.5] - 2026-11-14
### 升级注意事项
-- `--url`(`mcp --url`、`task … --url`、`IPHONE_CONTROL_URL`)指向另一台机器时不再接受 `http://`,免得登录令牌明文传出去:请改用 `https://<地址>:<端口>`(自签证书加 `--ca`)。本机的 `http://127.0.0.1` 照旧。
-- 只读令牌不会再让手机自动解锁:手机锁着时,它读元素会提示手机已锁屏。
+- `--url` 指向另一台机器时必须用 `https://`(自签证书加 `--ca`),本机的 `http://127.0.0.1` 照旧(#89)。
+- 只读令牌不再让手机自动解锁(#89)。
-### 变更
+### 改进
-- 控制台的登录页换成了和控制台一致的样子:同样的配色和磨砂卡片,明暗跟着控制台里的选择(没选过就跟系统)。令牌框可以显示粘贴的内容,`viewer token` 命令带复制按钮,令牌不对时用醒目的提示条;语言跟着控制台里选的走,页面上也能切换。
-- 守护进程重启、或重启 WDA 后就绪快了约 10 秒(iPhone 上从 11 秒降到 1.4 秒):WDA 启动的结果一出来就收,不再等下一轮巡检。
-- 等「Enable UI Automation」密码时,每半分钟重新启动一次 WDA,原来是约 3 分钟一次。密码框只在启动 WDA 时出现(约 45 秒,且不是每次都出现),现在手机上大部分时间都有框可输,原来只有约四分之一的时间。
-- WDA 卡死后,一个请求没应答、再用 5 秒确认一次就判定卡死,工具调用等重启约 35 秒,原来要 90 秒。
-- 守护进程重启时,命令、MCP 调用和控制台会等它回来(最多 10 秒),不再直接失败;守护进程没在运行时照样马上报错。
-- 输错登录令牌太多次(一分钟 20 次)后不再连正确的令牌也拒绝:正确的令牌总能进,只有错的返回 429。原来谁能连上页面,就能借此让 `mcp --url`、远端的 `task` 命令和远端任务的 agent 都连不上。
-- `--url` 只有指向本机时才接受 `http://`:令牌不会明文发到另一台机器(请用 `https://`),也不再跟随跳转。
+- 登录页和控制台风格一致,有自己的明暗和语言切换(#97)。
+- 守护进程或 WDA 重启后约快 10 秒就绪(#90)。
+- 等「Enable UI Automation」密码时,手机上大部分时间都有密码框可输(#90)。
+- WDA 卡死后约 35 秒重启,原来要 90 秒(#90)。
+- 守护进程重启时,命令、MCP 调用和控制台会等它回来,不再直接失败(#90)。
+- 输错令牌太多次不再连正确的令牌也拒绝(#89)。
### 修复
-- WDA 不可用时,iOS 27 以下的设备(没有 HID 后备)做点按、滑动、触摸会立刻说明没有 HID 后备,和其他操作一样;不再白截一张图后报横竖屏的错,还让人"转回竖屏"。
-- 确认(`iphone_confirm`,或任务范围外的一步)不再冲掉你的暂停或接管:等任务恢复运行后才问。同时出现两个确认时依次问;原来第一个会被记成拒绝,第二个无法回答。
-- 你暂停或接管前 agent 刚发出的一步,不会在暂停或接管之后才执行;你交还前刚发出的点按,也不会在交还之后才执行。
-- 你交还控制后,agent 必须真的看过屏幕(截图成功)才能操作。
-- 只读令牌不会再让守护进程解锁手机(手机锁着时读元素会说明已锁屏)。
-- 删除或更换登录令牌后,用它打开的画面、任务事件、`/mcp` 流和任务租约 5 秒内断开。
-- 控制台启动的 agent 改在私有目录里工作(`$XDG_RUNTIME_DIR` 下,0700),不再用 `/tmp` 里别的用户能抢先建好、往里放文件的目录。
-- 控制台遇到文件描述符用完这类错误后不会再停止接受连接;一直不发完请求的连接 10 秒后断开(局域网里每台机器同时最多 8 个);`GET /api/agent/tasks/events` 不再让连接崩溃。
-- 断电时写了一半的任务记录会被删掉,不再越积越多。
+- 没有 WDA 时,iOS 27 以下的设备点按、滑动会马上说明需要 WDA(#98)。
+- 确认不再冲掉你的暂停或接管,同时出现两个确认时依次问(#88)。
+- 你暂停、接管或交还前 Agent 刚发出的一步,不会在之后才执行(#88)。
+- 交还控制后,Agent 要先看过屏幕才能操作(#88)。
+- 删除或更换登录令牌后,用它打开的连接 5 秒内全部断开(#89)。
+- 控制台启动的 Agent 改在私有目录里工作,不再用 `/tmp`(#89)。
+- 控制台出错后照常接受连接,并断开卡住的连接(#88)。
+- 断电时写了一半的任务记录会被清理(#88)。
## [0.2.4] - 2026-11-14
### 升级注意事项
-- 控制台(`iphone-control viewer`)和它的 `/mcp` 现在要登录,本机也一样。升级后运行 `iphone-control viewer token`,点开它打印的链接;浏览器登录一次记住 30 天。经 HTTP 接入 `/mcp` 的 MCP 客户端要带 `Authorization: Bearer <令牌>`(`viewer token` 会打印 `claude mcp add` 命令)。命令行、stdio 方式的 `iphone-control mcp` 和 `task run` 不受影响。
-- 开了 `--lan`(`IPHONE_CONTROL_VIEWER_LAN=1`)时,局域网里用 HTTPS:打开 `https://<地址>:<端口>/`,第一次核对证书指纹(`iphone-control service status` 显示)。
-
-### 新增
+- 控制台和它的 `/mcp` 要登录了。运行 `iphone-control viewer token`,打开它打印的链接;经 HTTP 接入的 MCP 客户端带 `Authorization: Bearer <令牌>`。命令行和 stdio 方式的 MCP 不受影响(#79)。
+- 开了 `--lan` 时,局域网里走 HTTPS,第一次打开时核对 `service status` 显示的证书指纹(#76)。
+- `ICTL_AGENT_GATE`、`ICTL_AGENT_TOKEN` 改成 `IPHONE_CONTROL_TASK_TOKEN`(#64)。
-- `iphone-control mcp --url https://<那台机器>:8200`:把 stdio 转到另一台机器控制台的 `/mcp`,只能填命令的 MCP 客户端也能操作接在那台机器上的手机。有任务口令就只带它,否则用 `IPHONE_CONTROL_VIEWER_TOKEN` 登录;`task run --url` 启动的命令已经设好 `IPHONE_CONTROL_URL`,里面照常配置的 `iphone-control mcp` 自动转接。
-- `task` 的所有子命令都能加 `--url`(或设 `IPHONE_CONTROL_URL`):`list`、`events`、`pause`、`resume`、`takeover`、`handback`、`stop`、`approve`、`reject` 经另一台机器的控制台操作,登录令牌放在 `IPHONE_CONTROL_VIEWER_TOKEN`。
-- 有名字的登录令牌,可以是只读的:`iphone-control viewer token add <名字> [--read-only]`、`list`、`show <名字> [--new]`、`remove <名字>`。只读令牌能看画面、设备状态和任务,所有操作(点按、输入、开任务、暂停、确认、切换设备、`/mcp`)都被拒绝,页面上也不显示操作入口。任务记录里写下是哪个令牌做的控制(`viewer:<名字>`)。令牌改存在 `viewer-tokens.json`,原来的令牌成了 `owner`,升级后不用重新登录;增删、换令牌马上生效,不用重启控制台。
-- 从另一台机器开任务:`iphone-control task run --url https://<那台机器>:8200 -- <命令>`(登录令牌放在 `IPHONE_CONTROL_VIEWER_TOKEN`),或者直接调 `POST /api/agent/tasks/open`,返回的事件流就是租约。另一台机器上的 agent 只拿任务口令:`/mcp` 认进行中任务的口令(请求头 `Iphone-Control-Task-Token`),它能为这个任务操作手机,但碰不到暂停、确认这些控制接口,不能批准自己。
-- 控制台和它的 `/mcp` 要登录了,本机也一样(控制台分不清本机的浏览器和经 frp、cloudflared 等反向代理转发进来的访问)。令牌第一次启动时生成,存在数据目录的 `viewer-tokens.json`(0600);`iphone-control viewer token` 显示令牌、本机和局域网的登录链接以及接入 HTTP MCP 的命令,`--new` 换一个新令牌。浏览器登录一次后记住 30 天;程序和 MCP 客户端用 `Authorization: Bearer <令牌>`。输错太多次(一分钟 20 次)后,一分钟内错的令牌一律返回 429。命令行、`iphone-control mcp`(stdio)和 `task run` 走本机的 Unix socket,不受影响。
-- MCP over HTTP:控制台同一个端口上的 `/mcp`(Streamable HTTP)提供和 `iphone-control mcp` 一样的工具,只能填 URL 的客户端、局域网里另一台电脑上的 agent(`--lan`,走 HTTPS)都能接入,例如 `claude mcp add --transport http iphone http://127.0.0.1:8200/mcp`。任务里的 agent 在请求头 `Iphone-Control-Task-Token` 里带上任务口令。和页面一样要登录;`--mcp off`(`IPHONE_CONTROL_VIEWER_MCP=off`)关掉。
-- 控制台对局域网开放(`--lan`)时改用 HTTPS,还是同一个端口:局域网里打开时画面也能用 H.264 或手机自己的 HEVC,不再退回 MJPEG,传输也加了密。默认用本机生成的自签证书(存在数据目录的 `viewer-tls/`,一直沿用),浏览器第一次打开会提示不受信任,核对启动时或 `service status` 显示的 SHA-256 指纹后继续;也可以用 `--tls-cert`/`--tls-key`(`IPHONE_CONTROL_VIEWER_TLS_CERT`/`_KEY`)换成自己的证书。局域网来的 `http://` 跳转到 `https://`,本机的 `http://127.0.0.1` 照旧。`--tls off`(`IPHONE_CONTROL_VIEWER_TLS=off`)恢复成 HTTP。
-- `iphone-control service viewer install` 把控制台装成登录后自动启动的后台服务(还有 `uninstall`、`start`、`stop`、`restart`)。端口和是否对局域网开放读设置文件(新增 `IPHONE_CONTROL_VIEWER_PORT`;`IPHONE_CONTROL_VIEWER_LAN`;新增 `IPHONE_CONTROL_VIEWER_LAN_HOSTS`),并记下安装时终端的 `PATH` 以找到 `claude` 和 `codex`。升级时先停下它、升级完再启动;有 AI 任务在跑时自动升级会推迟。
-- AI 任务的 Agent 不能再自己暂停、继续、接管、交还或确认,越界确认和 `iphone_confirm` 只能由人回答。带任务口令(`IPHONE_CONTROL_TASK_TOKEN`)的控制请求会被拒绝;控制台和 `task run` 启动的 Agent,连同它再启动的进程,也会被拒绝,即使去掉了口令,或者调用控制台的接口。在 macOS 上,调用控制台接口的这条路还查不出是哪个进程。停止任务不受限制。任务记录里会写下谁做了控制(控制台、命令行、任务的发起方)。
-- 设置菜单支持方向键选择、Enter 确认和 Esc 取消,保留数字选择;基础终端继续使用逐行提示。
-- `iphone-control completions <shell>` 可生成 Bash、Zsh 和 Fish 补全脚本,不启动守护进程、不访问设备。
-- `iphone-control viewer --lan`(或 `IPHONE_CONTROL_VIEWER_LAN=1`)让控制台也对局域网开放,还是同一个端口,走 HTTPS、要登录(见上文)。只接受局域网地址来的连接,只认本机自己的名字和地址;`--lan-host` 可以再加名字。
-- 控制台上开任务前可以限定 App 范围(Agent 旁边的 App 按钮):到了别的 App,每一步都先等你确认,和 `task run --app` 一样。任务卡片上显示范围,重新执行时沿用。
-- 任何 agent 平台都能用 AI 任务:`iphone-control task run -- <命令>` 在任务里运行命令,它启动的 `iphone-control mcp` 自动加入任务(控制台能看到每一步,可以暂停、接管、停止、确认)。`task list`、`task events`、`task pause`/`resume`/`takeover`/`handback`/`stop`、`task approve`/`reject` 在命令行里查看和控制任务。
-- 控制台会接上正在进行的任务:页面刷新后,以及在别处开的任务。
-- 任务可以限定 App(`task run --app 设置`):在别的 App 里操作、启动别的 App、打开网页以外的链接,每一步都先等你确认;同意后这个 App 就加入任务范围。
+### 新功能
-### 变更
+- 任何 Agent 都能用 AI 任务:`iphone-control task run -- <命令>`,用 `task list`、`events`、`pause`、`resume`、`takeover`、`handback`、`stop`、`approve`、`reject` 控制(#64)。
+- 任务可以限定 App:`task run --app`,或控制台上的 App 按钮。到了别的 App,每一步都先等你确认(#69、#70)。
+- Agent 不能暂停、批准或以其他方式控制自己的任务(#75)。
+- 页面刷新后,控制台会接上正在进行的任务,包括在别处开的(#64)。
+- `viewer --lan` 把控制台经 HTTPS 开放到局域网(#72、#76)。
+- 控制台同一端口提供 MCP over HTTP(`/mcp`)(#77)。
+- 有名字的登录令牌,可以是只读的:`viewer token add <名字> [--read-only]`(#80)。
+- 操作另一台机器上的手机:`mcp --url` 转到它的 `/mcp`,`task … --url` 在那里开任务、控制任务(#80、#82)。
+- `service viewer install` 把控制台装成后台服务(#74)。
+- 设置菜单可以用方向键选择;`iphone-control completions <shell>` 生成补全脚本(#71)。
-- 控制台的画面只能用上方的加减号缩放:触控板或触屏上双指捏合、按住 Ctrl/⌘ 滚动滚轮都不再缩放画面(拖动时很容易误触成缩放)。
-- AI 任务改由守护进程管理,不再由控制台管理。任务进行中,其他客户端(另一个 MCP 服务、命令行)可以看,但操作和切换设备都会被拒绝,用户接管后才放行;任务只操作开始时的那台设备。任务记录在数据目录(`tasks/`,最近 50 个);守护进程停止时还在进行的任务显示为已中断。
+### 改进
-### 移除
-
-- MCP 服务的 `ICTL_AGENT_GATE` / `ICTL_AGENT_TOKEN` 环境变量:任务里的 MCP 服务改用 `IPHONE_CONTROL_TASK_TOKEN`。
+- 任务由守护进程管理:任务进行中,其他客户端只能看、不能操作(#64)。
+- 画面只能用上方的 − / + 缩放,不再响应捏合(#68)。
### 修复
-- 接着多台设备时,每台的屏幕尺寸都记下来:之前只记最后一台,切到另一台再切回来后,WDA 起来之前(比如卡在「Enable UI Automation」密码框)iOS 27 的 HID 后备路线不知道这台的尺寸,截图、按键、点击都报「不知道屏幕尺寸」。
-- 通知标题写设备自己的名字:之前一律写「iPhone」,iPad 需要输入锁屏密码、离线、重签失败时也是,接着多台设备时看不出是哪一台。iPad 上的提示也改用系统弹窗的说法(「为 XCTest 输入 iPad 密码」)。`notify-test` 的样例用正在控制的设备。
-- 升级时检查新程序(运行它的 `--version`)偶尔会因为「Text file busy」失败:同一进程的其他线程恰好在新程序还以写方式打开时启动了子进程。现在遇到这种情况会稍等重试。
-- `task run`:命令自己用 `task finish` 结束任务后,不再在它正常退出时被立刻停掉、退出码变成 1。现在它有 5 秒自己退出,退出码就是它自己的;超时才停掉,这时任务完成则退出码为 0。
-- 在设置菜单中长按方向键时,选项会连续移动,按键序列不会回显到菜单里。
-- 控制台上 AI 任务的总结按格式显示:粗体、列表、行内代码和换行不再显示成 Markdown 原文。
-- iOS 27 及以上,控制台实时画面里看不到的系统弹窗(例如「允许“日历”使用你的位置?」这类权限请求)现在画在画面里它所在的位置,带着弹窗的按钮,点按钮就是点手机上的那个按钮。
-- 部分 iPhone(如 iPhone 15 Pro Max,iOS 27.0.1)上锁屏不再每次要 10 秒左右:经 IOHID 短按电源键在这些设备上不起作用,守护进程会按设备记住,之后先用 WDA 的锁屏(约 2 秒)。
-- iOS 27 以下的 iPad 现在能锁屏了(iPad mini 5,iPadOS 26.7.3:一直锁不上),iPhone 15 Pro Max 第一次锁屏也从约 10 秒变成约 2 秒:经 IOHID 按电源键改成按 0.15 秒,原来的 0.1 秒这些设备不认。
-- WDA 还应答 `/status`、经 XCTest 的请求却全都不应答(前台 App、截图、读元素、锁屏状态全部超时)时,现在约 30 秒内就会发现并重启它,工具调用接连不断时也一样(经 XCTest 的请求连续 3 次没有应答后,不再一次次等满时限)。以前守护进程一直显示「就绪」,后台模式(`ICTL_WDA_DETACHED`)下连重启守护进程都会把卡死的 WDA 接回来。
-- iOS 27 以下的设备上,WDA 没能锁屏时(经 IOHID 按电源键、WDA 自己的锁屏都没锁上)报的是「WDA 不可用(刚掉线)」,其实 WDA 好好的。现在如实说两种锁屏办法各自的结果。
+- 部分 iPhone 锁屏从约 10 秒降到约 2 秒,iOS 27 以下的 iPad 也能锁屏了(#59、#63)。
+- WDA 还应答 `/status`、其他请求都不应答时,约 30 秒内会被重启(#60、#62)。
+- 锁屏失败时如实说明两种锁屏办法各自的结果,不再报「WDA 刚掉线」(#61)。
+- iOS 27 上,手机视频里看不到的系统弹窗会画在画面上,可以直接点(#67)。
+- 控制台上的任务总结按格式显示,不再是 Markdown 原文(#66)。
+- 接着多台设备时,每台的屏幕尺寸都记住,不再只记最后一台(#86)。
+- 通知标题写设备自己的名字,不再一律写「iPhone」(#85)。
+- 升级不再偶尔因「Text file busy」失败(#81)。
+- `task finish` 之后,`task run` 保留命令自己的退出码(#78)。
+- 在设置菜单里长按方向键不再回显按键序列(#73)。
## [0.2.3] - 2026-11-13
### 升级注意事项
-- 从 0.2.2 升级:0.2.2 的命令行还没有不带子命令的 `update`。签名安装脚本装的受管服务运行 `iphone-control update apply`;Homebrew 运行 `brew upgrade iphone-control`;Debian / Ubuntu 从发布页下载对应架构的 `.deb`,用 `sudo apt install ./<文件名>` 安装。升级到 0.2.3 之后,直接运行 `iphone-control update` 即可。
-
-### 新增
-
-- 运行 `iphone-control update` 可检查并通过受管服务、Homebrew 或 Debian 软件包升级到新稳定版。已是最新时会直接提示。只想检查可继续用 `update check`。
-- `iphone-control update` 安装前先说明要做什么并询问,`--yes` 跳过询问。Homebrew 和 Debian 升级后,正在运行的后台服务会自动重启到新版本。
-- Debian 软件包也有发布者签名,`iphone-control update` 验证签名后才用 sudo 交给 APT 安装。APT 里锁定(hold)的包会提示先解除锁定。
+- 从 0.2.2 升级要手动一次:脚本安装运行 `iphone-control update apply`,Homebrew 运行 `brew upgrade iphone-control`,Debian / Ubuntu 运行 `sudo apt install ./<文件名>.deb`。之后直接用 `iphone-control update`(#51)。
+- 去掉了 `update rollback`。新版本起不来时仍会自动换回旧版本(#52)。
-### 移除
+### 新功能
-- `iphone-control update rollback` 和升级后保留的上一版程序。新版本起不来时仍会自动换回旧版本。
-- 发布清单里的回滚兼容标记:任何更新的签名稳定版都能直接升级,不再因“需要手动迁移”而停下。
+- `iphone-control update` 检查并安装新稳定版,支持脚本安装的服务、Homebrew 和 `.deb`。安装前会先问,`--yes` 跳过(#51、#52)。
+- Debian 软件包有签名,安装前会验证(#52)。
### 修复
-- 控制台开着、浏览器解不了 HEVC(Firefox、多数 Linux 上的 Chrome)或设备低于 iOS 27 时,WDA 不再每 1~2 分钟被 iOS 杀掉一次:画面改成原尺寸、横屏时由页面转正,WDA 直接转发手机硬件编好的截图,不再逐帧缩放、旋转、重新编码,CPU 不再超出 iOS 的上限。
-- `iphone-control status | head -1` 这类把输出接给提前退出的程序的用法,不再报 “Broken pipe” 崩溃,而是像其他命令行工具一样直接结束。
-- 控制台的触控恢复灵敏:按下时不再每次都向 WDA 量屏幕尺寸(每次约 0.1~0.2 秒,0.2.2 引入),只在转屏时和最多每分钟量一次。鼠标在画面上移动时也保持触控会话打开,停顿后的第一下不用再等约 0.5 秒重开。
+- 控制台显示 H.264 或 MJPEG 时,WDA 不再每 1~2 分钟被 iOS 杀掉(#55)。
+- 控制台的触控恢复灵敏(#54)。
+- `iphone-control status | head -1` 这类用法不再报「Broken pipe」崩溃(#53)。
## [0.2.2] - 2026-11-12
### 升级注意事项
-- 使用脚本新装时,请从发布者的已签名 GitHub Release 下载 `install.sh`,需要 Python 3 和 OpenSSL 3。旧版脚本用户请先停止服务,用原安装脚本卸载,再运行新脚本。以 0.2.0 为例,从原发布仓库的 `v0.2.0` 标签取出旧脚本,传入 `--uninstall` 和原安装前缀。设置和设备数据都会保留。
+- 新装用签名 GitHub Release 里的 `install.sh`,需要 Python 3 和 OpenSSL 3。旧版脚本安装要先用原脚本卸载,设置和设备数据会保留(#44)。
-### 新增
+### 新功能
-- 运行 `iphone-control update check` 或打开控制台的「关于与更新」,可查看当前构建的发布者提供的最新稳定版。发现新版后,Viewer 会在按钮上显示红点。打开面板即可查看版本号,并在有适用命令时一键复制。
-- 通过签名发行包的安装脚本部署的用户服务可用 `iphone-control update apply` 升级,用 `iphone-control update rollback` 回滚。默认仅检查更新。运行 `iphone-control update policy auto-patch` 后,服务会在空闲时自动安装签名补丁,新守护进程健康检查失败时恢复旧版本。
-- 控制台改版:工作区适配宽窄窗口,侧栏和浮层用磨砂表面(高对比度或减少透明度时为实色),任务输入、执行器和设置集中在侧栏底部。设备显示商品名(如 iPhone 15 Pro,而不是 `iPhone16,1`)并套用 iPhone 或 iPad 外框;状态栏区分等待设备、正在连接、仅可观看、实时画面和画面断开。
+- 检查更新:`iphone-control update check`,或控制台的「关于与更新」(#44)。
+- 脚本安装用 `update apply` 升级,`update policy auto-patch` 可开启自动安装签名补丁(#44)。
+- 控制台改版,适配宽窄窗口,显示设备名称和外框(#45)。
### 修复
-- 控制台的点击、滑动和实时触控绑定到你看到的设备和画面:换机、转屏或断流后会被拒绝,不再点到旧位置。WDA 偶尔一次没响应不再重置画面、也不会在拖动中途松开手指;没有 `/rotation` 的 WDA 改从 SpringBoard 读方向。
-- 关闭或冻结的标签页留下的画面连接会被释放,反复重连不再占满控制台的连接数。
+- 换机、转屏或断流后,点按和触控会被拒绝,不再点到旧位置(#45)。
+- 关闭或冻结的标签页会释放画面连接(#45)。
## [0.2.1] - 2026-11-12
-### 新增
+### 新功能
-- iOS 27 及以上,控制台的画面直接用手机自己硬件编码的视频(CoreDevice 屏幕媒体流,HEVC):约每秒 60 帧、原生分辨率,本机不编码,WDA 也不用截图;转屏时画面跟着转正。浏览器解不了 HEVC(Firefox、多数 Linux 上的 Chrome)或设备低于 iOS 27 时自动改用 H.264 或 MJPEG。`IPHONE_CONTROL_VIEWER_CODEC=device` 只用这条流。
-- 控制台的画面改用 H.264,流量约为原来的 1/15:macOS 上本程序直接调 VideoToolbox(JPEG 也由硬件解码),不需要 ffmpeg;Linux 上装了 ffmpeg 时显卡编码优先(NVENC、VAAPI、QSV、V4L2,都不行用 x264);链路慢时降帧率,画面不会越来越滞后。没有 ffmpeg 时仍是 MJPEG,静止时不再重复发同一张。设置:`IPHONE_CONTROL_VIEWER_CODEC`、`IPHONE_CONTROL_VIEWER_QP`。
-- 实验开关 `ICTL_WDA_DETACHED=1`:在后台启动 WebDriverAgent、不持有 XCTest 会话,锁屏时也能启动,守护进程重启时它不跟着断。见 [WDA 依赖调研](docs/dev/wda-dependency-research.md)。
+- iOS 27 及以上,控制台直接显示手机自己的视频:HEVC,约 60 帧,原生分辨率(#42)。
+- 其他情况用 H.264,流量约为原来的 1/15,能用硬件编码就用(#42)。
+- 实验开关 `ICTL_WDA_DETACHED=1`:在后台启动 WDA,锁屏时也能启动(#41)。
### 修复
-- 控制台开着时 WDA 不再每隔几分钟被 iOS 杀掉(iOS 27 及以上):WDA 一直截图给画面用,CPU 超过一个核,iOS 按一分钟平均超过 80% 杀掉它,守护进程随之重启 WDA,期间操作失败。改用手机自己的视频后 WDA 的 CPU 约 3%。iOS 27 以下仍靠 WDA 截图,不看时请关掉控制台页面。
+- iOS 27 及以上,开着控制台时 WDA 不再每隔几分钟被 iOS 杀掉(#42)。
## [0.2.0] - 2026-11-11
### 升级注意事项
-- 不再发布 Docker:ghcr 上不再有镜像,也没有 `compose.yaml`。请改用一行命令的 `install.sh`、Homebrew 或 `.deb`(见「新增」)。先停掉容器(`docker compose down`),免得它占着手机。
-- 原来的数据在容器挂的卷里(`compose.yaml` 旁边的 `./data`,属于 root)。第一次运行前把它拷到 `~/.local/share/iphone-control` 并改成自己的(`sudo cp -a ./data ~/.local/share/iphone-control && sudo chown -R "$(id -un)": ~/.local/share/iphone-control`,见[数据与备份](https://derrors.github.io/iphone-control/deploy/backup)),Apple ID 会话、签好的 WebDriverAgent 和自动解锁密码就都还在。配对记录现在由系统的 usbmuxd 保存,手机可能会再问一次是否信任这台电脑。
-- 设置从 `.env` 搬到 `~/.config/iphone-control/env`(同样是 `KEY=value`,权限 0600)。首次运行引导会写好它;也可以把原来的值抄过去,再运行 `iphone-control service restart`。
-- `ICTL_MANAGE_USBMUXD`、`ICTL_USBMUXD_BIN` 已删除:守护进程不再自己启动 usbmuxd。Linux 上请装系统的 usbmuxd(`sudo apt install usbmuxd`,`.deb` 会自动装上);以前为容器 mask 过的,要 `sudo systemctl unmask usbmuxd`。
-- 重新注册 MCP:原来 `docker exec` 形式的注册不能用了。首次运行引导会注册,或者运行 `iphone-control mcp-config` 打印的命令。
-
-### 新增
-
-- 首次运行引导:装好后接上手机,运行 `iphone-control`。第一次会在终端里一步步带你完成设置:语言、代理、后台服务、配对、开发者模式、Apple ID、签名并安装 WebDriverAgent,可选的自动解锁密码和通知(Bark 或 Telegram,发一条测试消息),以及把 MCP 注册到 Claude Code 和 Codex。做过的步骤会跳过;设置好以后再运行 `iphone-control` 只显示状态,后台服务没在运行时先启动它。
-- `iphone-control setup --reconfigure`:全部重新设置,或只改一项:语言、代理、后台服务、Apple ID(重新登录并重签 WebDriverAgent)、手机、自动解锁密码、通知、注册 MCP。
-- `iphone-control service install|uninstall|start|stop|restart|status` 管理后台服务(macOS 是 launchd,Linux 是 systemd 用户服务),不管是 `install.sh`、`brew services` 还是 `.deb` 装的。
-- 设置文件 `~/.config/iphone-control/env`:后台服务读它,每个命令启动时也读它(环境里已经设了的变量优先)。手改后运行 `iphone-control service restart`。
-- 每个发布的压缩包和 `.deb` 里都带 `THIRD_PARTY_LICENSES.html`(所有 Rust 依赖的许可证)。
-- 控制台跟着守护进程控制的设备走:在别处切换了设备(另一个标签页、`iphone-control select`、MCP 工具,或拔掉后自动换了一台),页面约 10 秒内发现、提示,并把画面和各面板换过去。操作带着页面显示的那台设备,守护进程已经在控制别的设备时会被拒绝,不会发到另一部手机上。
-- 控制台没有画面时说明原因(没连上、要配对或开开发者模式、WebDriverAgent 正在启动或启动失败的原因、要先解锁);没装 WebDriverAgent 的设备,登录了 Apple ID 时会显示「签名并安装 WDA」按钮。
-- 签名证书被吊销时自动恢复:免费 Apple ID 同时最多两张证书,在别处(换机器、从 Docker 换成本机安装、别的侧载工具)用同一个 Apple ID 签名会新建证书并吊销一张旧的,用它签的 WDA 在每台设备上都起不来,描述文件却看着还有效。现在设备拒绝启动 WDA 时,守护进程会检查设备上的 WDA 是不是本机证书签的、本机证书还在不在 Apple ID 的团队里,有问题就自动重签这台(同一台 6 小时内最多一次)。
-- `doctor` 显示这两项证书检查;签名时新建或吊销证书会写日志并发通知(新的通知类型 `cert`,`notify-test cert` 可以试发)。
-- 安装更简单:macOS(Apple Silicon)和 Linux 上 `curl -fsSL https://raw.githubusercontent.com/Derrors/iphone-control/main/install.sh | sh` 一行装好 Release 的程序,并把守护进程装成用户服务(macOS 用 launchd,以前没有;Linux 用 systemd),再运行一次就是升级,也能卸载;`brew install derrors/tap/iphone-control` 加 `brew services start iphone-control`;Debian 12+ 和 Ubuntu 22.04+ 的 `.deb`(amd64、arm64),带 systemd 用户服务、依赖 usbmuxd。发布流程会打好这些包并更新 Homebrew 源。
-- 实时画面页面里的 AI 任务:在页面上写下任务,本机的 agent(Claude Code 或 Codex,在页面上选)用 MCP 工具在手机上完成;页面逐步显示 agent 说它要做什么、结果和截图,并在画面上标出点击位置。可以暂停、继续、接管(自己动手)后交还,或者停止。付款、删除、发消息、改账号设置之前,agent 会在页面上请你确认(`iphone_confirm`)并等你回答,拒绝的那一步不会执行。步骤、暂停和确认都经过 `iphone-control mcp` 本身,所以两种 agent 表现一样;agent 只能用操作手机的工具(Claude Code 不带命令行和文件工具,Codex 用只读沙箱)。
-
-### 变更
-
-- 新的实时画面页面:AI 助手、可缩放的实时画面,以及设备面板(状态和就绪检查、已安装的 App(启动、结束、打开链接)、屏幕上的元素(在画面上框出、按名字点、等文字出现))。可以在页面上切换设备,画面跟着换。AI 任务执行中手动操作会被拒绝,接管后才能操作。
-- iOS 27 起,viewer 的画面像触摸屏一样用:按下、移动、松开鼠标,手机上的手指跟着动(经 CoreDevice HID),拖动时列表跟着滚;在画面上滚动鼠标滚轮或触控板,不用按住鼠标就能滚动光标下的页面。点击往返从约 530 毫秒降到约 20 毫秒,拖动不再等列表停下(原来 1.8~3 秒)。iOS 27 以下仍在松开后发整段手势。用 viewer 操作时,HID 会话的屏幕媒体流会让手机保持亮屏,最后一次触摸 30 秒后关闭。
-- 实时画面约每秒 50 帧、75% 尺寸(WDA 默认每秒 10 帧、原尺寸)。
-- viewer 页面有中英文:默认跟着 `IPHONE_CONTROL_LANG`,页面上有按钮切换。守护进程的提示和 AI 任务(给 agent 的说明、工具结果)都跟着页面的语言。
-- viewer 的执行记录每一步只显示一句看得懂的话(agent 说它要做什么,没说时按操作写一句),不再显示截图、工具名、参数和原始结果;没成功的一步注明「这一步没成功」。agent 工具的截图也不再传给 viewer。
-- viewer 不再给自己的点击、滑动画轨迹,手动操作成功时也不再弹提示;出错照样提示。
-- viewer 新增只读的 JSON 接口(`/api/daemon`、`/status`、`/devices`、`/apps`、`/elements`),并拒绝浏览器标明来自其他网站的读取(`Sec-Fetch-Site`),因为读元素可能会解锁手机。
-
-### 移除
-
-- Docker 镜像(`ghcr.io/derrors/iphone-control`)、`compose.yaml`、`docker/Dockerfile` 和 `.dockerignore`。容器够不到控制台要交任务的本机 Claude Code 或 Codex,原生安装也更简单。
-- 守护进程不再启动、看护 usbmuxd(`ICTL_MANAGE_USBMUXD`、`ICTL_USBMUXD_BIN`),Linux 和 macOS 都用系统的 usbmuxd。
-- `deploy/iphone-control.service`:改由 `install.sh` 和 `iphone-control service install` 写服务文件。
-- `iphone-control mcp-config --container`:`mcp-config` 不再带参数,打印的路径在 Homebrew 升级后也有效。
+- 不再发布 Docker 镜像。先停掉容器(`docker compose down`),改用 `install.sh`、Homebrew 或 `.deb`。
+- 想保留 Apple ID 会话、签好的 WDA 和解锁密码,先把容器的 `./data` 复制到 `~/.local/share/iphone-control`([做法](https://derrors.github.io/iphone-control/deploy/backup))。手机可能会再问一次是否信任这台电脑。
+- 设置从 `.env` 搬到 `~/.config/iphone-control/env`。
+- 守护进程不再自己运行 usbmuxd。Linux 上装系统的(`sudo apt install usbmuxd`),之前为容器屏蔽过的要解除屏蔽。
+- 重新注册 MCP 服务:首次引导会做,或运行 `iphone-control mcp-config` 打印的命令。
+
+### 新功能
+
+- 一行安装:macOS(Apple Silicon)和 Linux 用 `install.sh`,还有 Homebrew 和 Debian 12+ / Ubuntu 22.04+ 的 `.deb`,都带后台服务。
+- 首次引导:装好后运行 `iphone-control`;`setup --reconfigure` 可以重做任意一部分。
+- `iphone-control service install|uninstall|start|stop|restart|status`。
+- 控制台上的 AI 任务:输入任务,Claude Code 或 Codex 在手机上完成。随时可以暂停、接管或停止,付款、删除、发送前会先问你。
+- 签名证书被吊销时会自动发现并重新签名。
+- 控制台跟着切换的设备走,说明没有画面的原因,还能签名并安装 WDA。
+
+### 改进
+
+- 新的控制台:AI 助手、可缩放的实时画面、带 App 和元素的设备面板,中英文都有。
+- iOS 27 及以上,画面像触屏一样操作:一次点按约 20 毫秒,原来约 530 毫秒。
+- 画面约每秒 50 帧。
### 修复
-- 控制台:iOS 27 以下的设备(整段手势模式)上,滚轮滚动不再没反应。原来滚轮一直在等一个这种模式下永远不会归零的剩余量,滑动发不出去,之后的滚轮也一起积压。
-- 刚启动 App、转场动画还没走完时按 Home,iPadOS 会把两种按法都忽略(iPad mini 5 / iPadOS 26.6.1 上约三次有一次)。现在两种都没回到主屏时,会再补按一次。
-- WebDriverAgent 启动失败、只报 `unexpected response` 时,提示里加上第二种可能:已经信任过开发者的,可能是签名证书变了,运行 `iphone-control sign` 重签这台设备。控制台在这种情况下,登录了 Apple ID 时会给出「重新签名并安装 WDA」按钮。
-- 自动选择设备时,守护进程重启后接着用上次就绪过的那台,不再按 usbmuxd 列表的顺序换到另一台(接着 iPhone 和 iPad 时,重启后可能换到一台起不来 WebDriverAgent 的设备)。
-- `iphone-control viewer` 在守护进程还没起来、又接着多台设备时不再直接退出:先照常启动,守护进程选好设备后页面自动跟上。
-- 控制台:iOS 27 以下的设备在 WebDriverAgent 没起来时,「操作通道」显示「不可用」,不再说改走 HID 后备(HID 后备要 iOS 27);不知道锁没锁时不再显示「未锁定」;WebDriverAgent 启动失败时画面区域显示失败原因,不再一直说「通常 10–60 秒」。
-- 日志和状态里的「WDA 启动失败:WDA 启动失败:」不再重复。
-- 命令行里 `devices`、`select`、`doctor` 的提示同时给出 `iphone-control select` / `iphone-control status`,不再只写 MCP 工具名;连不上守护进程时提示 `iphone-control service start`。
-- 新款 iPhone 上 `lock` 不再要 10 秒左右:电源键改为按 0.1 秒,不再按住 0.5 秒。iPhone 18 Pro Max(iOS 27.2.1)不认按住,每次锁屏都退到 WebDriverAgent 较慢的锁屏,还在日志里记一次超时。
-- 不认 IOHID Home 事件的设备(iPhone 18 Pro Max,iOS 27.2.1)上 `home` 从约 3.7 秒变为约 1.3 秒:只有 XCTest 的按法有效时,守护进程按设备记住,之后先用它。只认 IOHID 按法的设备(iPhone 12 mini)顺序不变。
-- 界面上一直有动画时,点击和长按不再要 26 秒左右(iPhone 18 Pro Max、iOS 27.2.1 上,键盘弹着时在设置里点搜索结果每次都这样):和滑动一样,不再等 WebDriverAgent 的动画冷却。同一个点击现在约 1.4 秒。
-- 手机断开 Web Inspector 连接时,`iphone_web_targets`、`iphone_web_eval` 提示去打开 设置 → Safari → 高级 → 网页检查器,不再只给一句 TLS 错误。
-- `iphone_app_logs` 不再返回 Info 级别的行,和工具说明一致(不带调试消息的日志流里,有些进程仍会发 Info)。
-- 英文的设备说明在括号前、逗号后加了空格:`name (model iOS version, UDID)`。
+- iOS 27 以下,控制台的鼠标滚轮恢复可用。
+- 新款 iPhone 上 `lock`、`home` 快了很多,界面有动画时点按不再要 26 秒。
+- iPad 上 App 切换动画中按的 Home 会再补按一次。
+- 重启后,守护进程沿用上次就绪的设备。
+- 守护进程还没选好设备时,`iphone-control viewer` 也能启动。
+- WDA 报 `unexpected response`、没开 Web Inspector、连不上守护进程时,提示更清楚。
+- `iphone_app_logs` 不再返回 Info 级别的日志。
## [0.1.5] - 2026-11-10
-### 新增
+### 新功能
-- 英文界面:设 `IPHONE_CONTROL_LANG=en` 后,工具说明和结果、命令行输出和帮助、`status`/`doctor`、日志、通知都改成英文。默认仍是简体中文,旧版本客户端照旧得到中文。
-- `iphone-control viewer [--port]`:在浏览器里看实时画面并操作手机(默认 127.0.0.1:8200,显式开启)。本机其他用户能连上这个端口,用完就停。
-- 开发者工具,设 `IPHONE_CONTROL_DEV_TOOLS=1` 开启:`iphone_app_logs`、`iphone_crash_reports`、`iphone_install_app`、`iphone_uninstall_app`、`iphone_web_targets`、`iphone_web_eval`。不设时工具列表不变。
+- 英文:`IPHONE_CONTROL_LANG=en` 切换工具、命令行、日志和通知的语言。
+- `iphone-control viewer`:在浏览器里看着手机操作。
+- 开发者工具(`IPHONE_CONTROL_DEV_TOOLS=1`):App 日志、崩溃报告、安装和卸载 App、Safari 的 Web Inspector。
### 修复
-- 任何系统语言下元素列表都会去掉滚动条,不再只认中文和英文。
-- `iphone_uninstall_app` 只接受 Bundle ID 或完整的显示名;空的、不完整的、对应多个 App 的名字都拒绝,并列出候选。
-- 安装 App 和重签互相排队,不再同时往手机上传。
-- 守护进程卡死时会自己退出,由 systemd 或 Docker 重启。
-- HID 后备期间内存不再增长。
-- `usbmuxd.log` 过大时会轮转。
+- 所有系统语言下,元素列表都去掉滚动条。
+- `iphone_uninstall_app` 拒绝不完整或有歧义的名字。
+- 安装 App 和重新签名不再同时上传。
+- 守护进程卡死时自己退出,由服务重启。
+- 用 HID 后备时内存不再增长,`usbmuxd.log` 会轮转。
## [0.1.4] - 2026-11-07
-### 安全
-
-- `zip` 升级到 9.4.1(原来是 8.6.0,vendor 的 apple-codesign 里是 2.6.1),修复 GHSA-m665-v7pm-7grj、GHSA-q7v9-x93c-xqv3、GHSA-hjqx-j4rw-g7xv、GHSA-9hj8-73fh-9963、GHSA-8hxf-qr8p-62x4。iphone-control 只解压核对过 sha256 的 Appium 官方 WDA 包,实际受影响的可能很小。
-- 文档站的构建工具改用 vite 6.4.5、esbuild 0.25(只是开发依赖,发布的网站不受影响)。
-
-### 变更
+### 改进
-- `ICTL_DDI_DIR`(自己提取的开发者镜像目录)不再往里下载,也不会删除里面的文件;缺文件时报出缺哪个。只有默认缓存 `ddi/` 在连续 3 次**挂载**失败后才清掉重新下载(建不起隧道不再计入)。
-- `debug` 子命令默认不再编译,需要时用 `--features debug-cmds` 编译。
-- 工具描述写明:配置了自动解锁时,截图、`iphone_list_elements`、`iphone_wait_for` 也会先解锁;HID 后备需要 iOS 27。
+- 不再往 `ICTL_DDI_DIR` 里写东西;只有默认缓存在挂载失败三次后重新下载。
+- `debug` 子命令要用 `--features debug-cmds` 编译。
### 修复
-- WebDriverAgent 请求已经发出、之后连接断开或响应不完整时,不再改用 HID 重做一遍(点击、输入可能执行两次),改为提示手机可能已经执行。
-- 对 usbmuxd、lockdown、AMFI、misagent、installation_proxy 的调用都加了时限:手机或 usbmuxd 接了连接却不应答时,守护进程不会再卡死。
-- 重签有总时限(15 分钟),苹果服务器或安装卡住时不再一直“正在重签”;Apple ID 会话检查也有时限。手机重新接上或切换设备后,1 分钟内就检查是否需要重签,不用等满 `RESIGN_CHECK_HOURS`。给一台设备重签完成时,不再拆掉期间切换过去的另一台的会话。
-- 手机重启后还没解锁、WDA 起不来时,`status` 一直显示需要解锁手机,每 20 秒重试一次,不再在“正在启动”和它之间来回切、每 10 秒重试。
-- 开启 HID 会话超时时,不再把屏幕媒体流留在手机上(不自动锁屏、灵动岛图标常驻)。
-- 取消 MCP 调用后真的会停下:`iphone_batch` 剩下的步骤不再执行,还在排队等设备的请求也会放弃。
-- `iphone_batch` 执行中控制的设备变了(例如拔掉后自动改控另一台)就停下。
-- 新启动的 WebDriverAgent 要等测试计划开始后才算就绪,手机上残留的旧 WDA 不会让它提前被当成就绪。
-- `doctor` 只把 iPhone、iPad、iPod 算作 USB 上的手机,接着苹果键盘时不再误报。
-- 点到的元素文字里正好含“系统弹窗”时,操作后的弹窗检查不再被跳过。
-- 自动解锁也能认出滑动、轮询中途被打断后残留的 WDA 等待设置,并恢复默认值。
-- iPad:WebDriverAgent 在 iPad 锁屏时启动会一直报“未锁”,而 Touch ID 机型熄屏、有通知时的锁屏上又没有锁的标记,以前会因此一直相信 WDA、永远不自动解锁。现在认不出时按可能锁着处理:配置了密码就自动解锁,`status` 显示“可能已锁屏”。
-- iPad:设置等 iPadOS 26 App 的浮动侧栏里的项目又能按名字点了,以前把列表背后和侧栏一样大的空容器误当成遮挡。
-- WDA 在两次巡检之间掉线时,提示改为“刚掉线”,不再显示成“就绪”。
+- 安全:`zip` 升级到 9.4.1,修复 GHSA-m665-v7pm-7grj 等问题,实际影响很小。
+- 连接断开的操作不再经 HID 重做一遍。
+- 访问手机、usbmuxd 和苹果服务器都有时限,守护进程不会卡死在这些调用上。
+- 重新连接或切换设备后,一分钟内检查是否要重新签名。
+- 取消 MCP 调用会真的停下,包括 `iphone_batch` 剩下的步骤;设备变了,批量操作也会停。
+- 超时的 HID 会话不再让手机的屏幕流一直开着。
+- 旧的 WDA 不会被误判为已就绪,WDA 刚掉线时会如实报告。
+- iPad:锁屏时启动 WDA 后自动解锁照常工作,侧栏的行又能按名字点了。
+- `doctor` 不再把苹果键盘当成手机。
## [0.1.3] - 2026-11-07
### 升级注意事项
-- 自动解锁密码改为按设备保存。升级前只连接旧版保存密码所对应的那台设备:仅连接一台时,旧密码会自动归到它名下。若不确定旧密码属于哪台,请先用旧版 `passcode clear` 清除,再升级并分别运行 `passcode set --device <UDID>` 设置。操作前先备份数据目录。
-- 所有客户端共享同一台被控设备。显式 `select` 选择会跨守护进程重启保留;自动模式只在进程运行期间、当前设备不断开的情况下保持选择。
-- 横屏 HID 后备触摸需要 30 秒内且匹配的 WDA 旋转角。WDA 不可用期间不要从一个横屏方向翻到另一侧;请等 WDA 恢复后再翻转。
+- 自动解锁密码改为按设备保存。升级前只接着存过密码的那台设备,或先清掉密码,再用 `passcode set --device <UDID>` 逐台设置。
+- 所有客户端共用设备选择,`select` 的选择在重启后保留。
+- 没有 WDA 时,横屏状态下不要把设备转到另一侧横屏。
-### 新增
+### 新功能
-- 接着多台 iPhone/iPad 时可以选择控制哪一台:新增 MCP 工具 `iphone_list_devices`、`iphone_select_device`,命令 `devices`、`select`。选定的设备写进 state.json,重启后还记得;`select auto` 改回自动选。设了 `IPHONE_UDID` 时以它为准、不能切换。
-- 自动解锁密码按设备分开存(`secrets/passcodes/<UDID>`),`passcode set/clear` 可加 `--device`。旧版本的那份密码在 USB 上只接着一台时自动归到那台名下,接着多台时不会用。
+- 选择要控制的设备:`iphone_list_devices`、`iphone_select_device`,或命令 `devices`、`select`。
+- 自动解锁密码按设备保存。
### 修复
-- 转屏后实时更新屏幕尺寸,避免截图拉伸和屏幕下部元素被过滤;将 iPad 横屏系统界面的竖屏坐标换算为屏幕坐标,按状态栏位置区分两个横屏方向。
-- Touch ID 设备自动解锁会先点“使用密码”;补全锁屏识别及 iPad 删除键定位,并在输入前校验数字键布局。
-- 经 misagent 读取当前设备已安装的 WDA 描述文件,供 `doctor`、`status` 和自动重签判断到期时间,避免混用另一台设备的签名记录。
-- `setup` 在签名安装前等待守护进程识别目标设备;修正设备离线和 iOS 低于 27 时的提示,并为 WDA 启动的笼统错误补充首次安装时信任开发者的排查提示。
-- `open_url` 等待前台 App 稳定后返回,减少冷启动时截到黑屏或把短暂系统服务当成目标 App 的情况。
-- HID 后备路线的点击、滑动会把横屏坐标换算回设备原生的竖屏坐标;持久化尺寸和复用的 HID 会话都按竖屏归一化。每次后备触摸前重新截图核对方向;横屏还需 30 秒内且匹配的 WDA 旋转角,缺失时(包括守护进程刚重启)拒绝触摸。WDA 不可用期间不要从一个横屏方向翻到另一个:仅凭截图宽高无法识别 180° 翻转。
-- 没设 `IPHONE_UDID`、接着多台时,usbmuxd 列表顺序变了会悄悄换成控制另一台(自动解锁可能把一台的密码输进另一台)。现在正在控制的那台一直用到它断开。
-- 设了 `IPHONE_UDID` 而那台没接、另一台接着时,usbmuxd 每 30 秒被重启一次。
-- 容器里已经接着一台时再插一台,usbmuxd 认不到新的那台(没有 udev,收不到热插拔),也不会被重启。现在比较 USB 上和 usbmuxd 认到的 iPhone/iPad 台数。
-- 换设备后还用上一台的 App 列表缓存和屏幕尺寸。
+- 屏幕尺寸跟着转屏变:截图不再被拉伸、元素不再丢失,iPad 横屏坐标正确。
+- HID 后备的点按和滑动在横屏下正确,方向不明时会拒绝。
+- Touch ID 设备自动解锁时先点「使用密码」,并核对数字键盘。
+- usbmuxd 列表顺序变化时,不再跳到另一台设备。
+- `doctor`、`status` 和重新签名读当前设备自己的 WDA 描述文件。
+- `setup` 等到设备就绪再签名,`open_url` 等 App 打开后再返回。
+- 切换设备后不再沿用上一台的 App 列表和屏幕尺寸。
+- `IPHONE_UDID` 指向的设备不在时,不再每 30 秒重启 usbmuxd;容器里能认出第二台设备。
## [0.1.2] - 2026-11-04
-### 新增
+### 新功能
-- Releases 里提供 macOS 预编译二进制(Apple Silicon,macOS 11 以上):`iphone-control-vX.Y.Z-macos-arm64.tar.gz`。没有经过苹果公证,被 Gatekeeper 拦下时见 macOS 指南。
+- 预编译的 macOS 二进制(Apple Silicon,macOS 11+)。没有公证,见 macOS 指南。
## [0.1.1] - 2026-11-04
-### 新增
+### 新功能
-- 支持 macOS(Apple Silicon):从源码编译,以普通用户运行,用系统自带的 usbmuxd,不需要 Xcode。见新增的 macOS 使用指南。
+- 支持 macOS(Apple Silicon),不需要 Xcode。
-### 变更
+### 改进
-- MCP 工具描述说明了何时用、返回什么、具体行为,每个参数都有说明,每个工具都带 MCP 注解。工具名、参数和返回结果不变。
-- Release 里的二进制压缩包改名为 `iphone-control-vX.Y.Z-linux-<架构>.tar.gz`。
+- 工具说明写清楚每个工具什么时候用、返回什么。
+- 发布文件改名为 `iphone-control-vX.Y.Z-linux-<arch>.tar.gz`。
### 修复
-- 部分手机上 `home`、`lock` 没有效果(在 iPhone 12 mini、iOS 26.4.1 上遇到),自动解锁也点不亮熄灭的屏幕。
-- 用系统 usbmuxd 的部署(macOS、Linux 从源码运行)断开几秒后会卡在「bad device」,现在能自己重连。
-- macOS 上 `doctor` 不再误报「USB 上没有 Apple 设备」,修复提示改用 macOS 的命令。
-- 自动解锁调不出密码键盘时,提示里说明待机显示会挡住键盘。
+- iPhone 12 mini 等手机上 `home`、`lock` 和自动解锁时的唤醒恢复可用。
+- 用系统 usbmuxd 时,短暂断开后能自己重连。
+- `doctor` 在 macOS 上可用。
## [0.1.0] - 2026-11-02
首个公开版本。
-### 新增
+### 新功能
-- 守护进程独占手机:usbmuxd 看护、配对和开发者模式检查、开发者镜像下载挂载、启动 WebDriverAgent;拔插、usbmuxd 重启、手机重启后自动恢复。
-- MCP 服务,15 个工具:截图(可放大区域)、元素列表、点击、长按、滑动、输入(支持中文)、按键、App 启动/结束、打开链接、`iphone_wait_for`、`iphone_batch`;操作类工具可用 `then` 顺带返回操作后的界面。
-- WebDriverAgent 不可用时,点击、滑动、按键、截图经 HID 后备完成。
-- 用免费 Apple ID 签名 WebDriverAgent(支持双重认证),7 天描述文件到期前自动重签,每天检查 Apple ID 会话。
-- Bark、Telegram 通知;可选的自动解锁(输错一次即停用)。
-- `setup`、`doctor`、`status`、`mcp-config`、`wda-bridge`、`notify-test` 命令。
-- Docker 镜像(非 privileged,linux/amd64、linux/arm64);也可不用 Docker,从源码或预编译二进制以普通用户运行,附 systemd 用户服务。
+- 守护进程管理手机:配对、开发者模式、开发者镜像、隧道和 WebDriverAgent,拔线、重启后自动恢复。
+- MCP 服务,15 个工具:截图、元素、点按、滑动、输入(支持中文)、按键、App、链接、等待和批量操作。
+- WDA 不可用时的 HID 后备。
+- 用免费 Apple ID 签名 WDA,过期前自动重签。
+- Bark、Telegram 通知,可选的自动解锁。
+- `setup`、`doctor`、`status`、`mcp-config`。
+- Docker 镜像和预编译的 Linux 二进制。
[Unreleased]: https://github.com/Derrors/iphone-control/compare/v0.2.6...HEAD
[0.2.6]: https://github.com/Derrors/iphone-control/compare/v0.2.5...v0.2.6
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7b4e624..9515902 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -132,7 +132,16 @@ Part 2 checks that a change doesn't break what already works; this part shows th
- Keep them focused; describe what changed and why.
- The tests above pass and are reported in the template ([Required tests](#required-tests)). Bug fixes and features without real-device results are not merged.
- CI must pass: format, clippy with `-D warnings`, tests (on Linux and macOS), the MSRV check, gitleaks and the package checks (`.deb`, `install.sh`, the Homebrew formula).
-- User-visible changes get a line in [CHANGELOG.md](CHANGELOG.md) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) under *Unreleased* (a Chinese line is welcome but optional for outside contributors; maintainers add it before release).
+- User-visible changes get a line in [CHANGELOG.md](CHANGELOG.md) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) under *Unreleased* (a Chinese line is welcome but optional for outside contributors; maintainers add it before release). See [Changelog entries](#changelog-entries).
+
+### Changelog entries
+
+The changelog is the release notes, so write for someone deciding whether to upgrade:
+
+- One line, one sentence or two, ending with the pull request number: `- Swipes on the control page return sooner (#108).`
+- Say what the user sees or can now do, not how it works. Leave out causes, timeouts, endpoints and measurements; they belong in the pull request. A number stays only when it is the point ("about half the traffic").
+- Pick the section: *Upgrade notes* (something you must do or that stops working), *New*, *Improvements*, *Fixes* (*升级注意事项*, *新功能*, *改进*, *修复*). Leave out empty ones.
+- Internal changes (refactors, tests, CI, docs) get no line.
## Documentation site
@@ -140,7 +149,7 @@ The user guide at [derrors.github.io/iphone-control](https://derrors.github.io/i
## Releasing (maintainers)
-1. Move the *Unreleased* entries in [CHANGELOG.md](CHANGELOG.md) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) under `## [x.y.z] - YYYY-MM-DD` and update the compare links at the bottom. Both files need the section — the release notes are built from the two (English, then Chinese) and the workflow fails if either is missing. Keep entries short: one line per user-visible change, no implementation details.
+1. Move the *Unreleased* entries in [CHANGELOG.md](CHANGELOG.md) and [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) under `## [x.y.z] - YYYY-MM-DD` and update the compare links at the bottom. Both files need the section — the release notes are built from the two (English, then Chinese) and the workflow fails if either is missing. Check the entries against [Changelog entries](#changelog-entries).
2. Set `version` in the root `Cargo.toml` (`[workspace.package]`) and run `cargo check --workspace` to update `Cargo.lock`.
3. Configure the publisher and signing keys before tagging (any newer signed stable release can be installed from any version; there is no per-release upgrade path to set). Commit, tag `vx.y.z` and push the tag. The release workflow builds the Linux archives and Debian packages, creates the GitHub Release from both changelogs, then adds the Apple Silicon archive. Stable releases also publish the installer and signed platform manifests. If a tap is configured, the workflow updates its formula after signing all three archives. See the [release configuration](docs/dev/release-updates.md) and [release workflow](.github/workflows/release.yml).
4. Update Glama: on glama.ai, the build steps under this server's *Admin → Dockerfile* pin the version. Change it and rebuild.