Control a real USB-connected iPhone from Linux (no Mac, no paid developer account) and expose it to AI agents as MCP tools
Rust ai-agentautomationclaudeclaude-codedockeriosiphonelinuxmcpmcp-servermodel-context-protocolrustwebdriveragent
发布:附件名去掉 unknown,发布说明加中文
Derrorsa49950cc5afa
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.mdindex 514c55b..0c9cb2c 100644--- a/.github/PULL_REQUEST_TEMPLATE.md+++ b/.github/PULL_REQUEST_TEMPLATE.md@@ -12,5 +12,5 @@- [ ] MCP tool names, parameters and default outputs stay compatible (docs/decisions.md D10)- [ ] New or changed dependencies are pinned to exact versions; vendor changes recorded in THIRD_PARTY.md-- [ ] User-visible changes noted in CHANGELOG.md under *Unreleased*+- [ ] User-visible changes noted in CHANGELOG.md (and CHANGELOG.zh-CN.md if you can) under *Unreleased*- [ ] No private data in fixtures, screenshots or logsdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 07e5b2e..cf6d7b5 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -1,7 +1,7 @@name: Release# 推送 v* tag 时:多架构镜像推到 ghcr(各架构在原生 runner 上构建,不用 QEMU 模拟),-# 附 SBOM 和构建来源证明;Linux 二进制和 sha256 附在 GitHub Release 上,发布说明取自 CHANGELOG.md。+# 附 SBOM 和构建来源证明;Linux 二进制和 sha256 附在 GitHub Release 上,发布说明取自 CHANGELOG.md 和 CHANGELOG.zh-CN.md。on:push:tags: ["v*"]@@ -19,10 +19,13 @@ jobs:strategy:matrix:include:+ # 文件名用 linux-<arch>(arch 与 uname -m 一致),不用 Rust 的 target 名(x86_64-unknown-linux-gnu)- runner: ubuntu-22.04target: x86_64-unknown-linux-gnu+ arch: x86_64- runner: ubuntu-22.04-armtarget: aarch64-unknown-linux-gnu+ arch: aarch64runs-on: ${{ matrix.runner }}steps:- uses: actions/checkout@v4@@ -33,16 +36,16 @@ jobs:- run: cargo build --release --locked -p iphone-control- name: Packagerun: |- name="iphone-control-${GITHUB_REF_NAME}-${{ matrix.target }}"+ name="iphone-control-${GITHUB_REF_NAME}-linux-${{ matrix.arch }}"mkdir -p "dist/$name"- cp target/release/iphone-control LICENSE THIRD_PARTY.md README.md README.zh-CN.md CHANGELOG.md "dist/$name/"+ cp target/release/iphone-control LICENSE THIRD_PARTY.md README.md README.zh-CN.md CHANGELOG.md CHANGELOG.zh-CN.md "dist/$name/"cp -r deploy "dist/$name/"cp .env.example "dist/$name/env.example"tar -C dist -czf "dist/$name.tar.gz" "$name"(cd dist && sha256sum "$name.tar.gz" > "$name.tar.gz.sha256")- uses: actions/upload-artifact@v4with:- name: bin-${{ matrix.target }}+ name: bin-${{ matrix.arch }}path: dist/*.tar.gz*if-no-files-found: error@@ -149,22 +152,32 @@ jobs:path: distpattern: bin-*merge-multiple: true- - name: Release notes from CHANGELOG.md+ # 英文、中文各一节,末尾一行镜像和下载说明。两个文件都要有这个版本的一节,缺了就失败+ - name: Release notes from CHANGELOG.md and CHANGELOG.zh-CN.mdrun: |version="${GITHUB_REF_NAME#v}"- # 「## [1.2.3]」到下一个「## [」之间- awk -v v="$version" '- /^## \[/ { if (found) exit; if (index($0, "## [" v "]") == 1) { found = 1; next } }- found { print }- ' CHANGELOG.md > notes.md- if [ ! -s notes.md ]; then- echo "CHANGELOG.md 里没有 ## [$version] 一节" >&2- exit 1- fi+ section() {+ # 「## [1.2.3]」到下一个「## [」之间,去掉链接定义行和首尾空行+ awk -v v="$version" '+ /^## \[/ { if (found) exit; if (index($0, "## [" v "]") == 1) { found = 1; next } }+ found && !/^\[[^]]+\]: / { print }+ ' "$1" | sed -e '/./,$!d' | sed -e ':a' -e '/^\n*$/{$d;N;ba' -e '}'+ }+ en=$(section CHANGELOG.md)+ zh=$(section CHANGELOG.zh-CN.md)+ for f in en zh; do+ if [ -z "${!f}" ]; then+ echo "更新日志($f)里没有 ## [$version] 一节" >&2+ exit 1+ fi+ done{- echo- echo "**Docker image:** \`${IMAGE}:${version}\` (linux/amd64, linux/arm64)"- } >> notes.md+ echo "## English"; echo; echo "$en"; echo+ echo "## 中文"; echo; echo "$zh"; echo+ echo "---"; echo+ echo "**Docker:** \`${IMAGE}:${version}\` (linux/amd64, linux/arm64)"; echo+ echo "**Binaries / 二进制:** \`linux-x86_64\`, \`linux-aarch64\` (glibc 2.34+)"+ } > notes.md- name: Create releaserun: |flags=()diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 158b6e4..959451d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,7 @@# Changelog+**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).## [Unreleased]diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.mdnew file mode 100644index 0000000..0d45552--- /dev/null+++ b/CHANGELOG.zh-CN.md@@ -0,0 +1,24 @@+# 更新日志++[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) 一一对应,发布说明从这两个文件里取。++## [Unreleased]++## [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 用户服务。++[Unreleased]: https://github.com/Derrors/iphone-control/compare/v0.1.0...HEAD+[0.1.0]: https://github.com/Derrors/iphone-control/releases/tag/v0.1.0diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex cf8f3ee..7b71a67 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -71,7 +71,7 @@ Notes:- Keep them focused; describe what changed and how you tested it (offline and/or which device).- CI must pass: format, clippy with `-D warnings`, tests, the MSRV check, gitleaks and the image build.-- User-visible changes get a line in [CHANGELOG.md](CHANGELOG.md) under *Unreleased*.+- 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).## Documentation site@@ -79,9 +79,9 @@ 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) under `## [x.y.z] - YYYY-MM-DD` and update the compare links at the bottom.+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.2. Set `version` in the root `Cargo.toml` (`[workspace.package]`) and run `cargo check --workspace` to update `Cargo.lock`.-3. Commit, tag `vx.y.z`, push the tag. [`release.yml`](.github/workflows/release.yml) builds the amd64/arm64 images on native runners and pushes them to `ghcr.io/derrors/iphone-control` (tags `x.y.z`, `x.y`, `latest`; pre-releases such as `v0.2.0-rc.1` only get their own tag), builds the Linux binaries, and creates the GitHub release from the changelog section.+3. Commit, tag `vx.y.z`, push the tag. [`release.yml`](.github/workflows/release.yml) builds the amd64/arm64 images on native runners and pushes them to `ghcr.io/derrors/iphone-control` (tags `x.y.z`, `x.y`, `latest`; pre-releases such as `v0.2.0-rc.1` only get their own tag), builds the Linux binaries (`iphone-control-vx.y.z-linux-x86_64.tar.gz`, `…-linux-aarch64.tar.gz`), and creates the GitHub release from the two changelog sections.4. First release only: make the ghcr package public (*Package settings → Change visibility*) — new packages start private.By contributing you agree that your contributions are licensed under the MIT license, except for changes to vendored files, which stay under their original licenses.diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 25d9920..34b6b6d 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -135,7 +135,7 @@ claude mcp add iphone -s user -- docker exec -i iphone-control iphone-control mc| 安装 | [Docker](https://derrors.github.io/iphone-control/deploy/docker) · [从源码 / 二进制](https://derrors.github.io/iphone-control/deploy/source) · [数据与备份](https://derrors.github.io/iphone-control/deploy/backup) || 问题 | [常见问题](https://derrors.github.io/iphone-control/troubleshoot/faq) · [排错(英文)](docs/troubleshooting.md) · [Issues](https://github.com/Derrors/iphone-control/issues) || 安全 | [SECURITY.md](SECURITY.md):存了什么、谁能访问、怎么报告漏洞 |-| 开发 | [贡献指南](CONTRIBUTING.md) · [架构](docs/architecture.md) · [关键取舍](docs/decisions.md) · [更新日志](CHANGELOG.md) |+| 开发 | [贡献指南](CONTRIBUTING.md) · [架构](docs/architecture.md) · [关键取舍](docs/decisions.md) · [更新日志](CHANGELOG.zh-CN.md) || 许可证 | [THIRD_PARTY.md](THIRD_PARTY.md):vendor 组件、版本和许可证 |## 限制diff --git a/website/.vitepress/config.mts b/website/.vitepress/config.mtsindex 418ab7f..38248b8 100644--- a/website/.vitepress/config.mts+++ b/website/.vitepress/config.mts@@ -20,7 +20,7 @@ export default defineConfig({nav: [{ text: '首页', link: '/' },{ text: '指南', link: '/guide/what-is-iphone-control' },- { text: '更新日志', link: `${repo}/blob/main/CHANGELOG.md` },+ { text: '更新日志', link: `${repo}/blob/main/CHANGELOG.zh-CN.md` },],sidebar: [{diff --git a/website/deploy/source.md b/website/deploy/source.mdindex 0d851d0..3f7ed4f 100644--- a/website/deploy/source.md+++ b/website/deploy/source.md@@ -10,7 +10,7 @@```bashsudo apt install usbmuxd-tar xzf iphone-control-v*-x86_64-unknown-linux-gnu.tar.gz+tar xzf iphone-control-v*-x86_64*.tar.gz # ARM 主机把 x86_64 换成 aarch64(看 uname -m)install -Dm755 iphone-control-*/iphone-control ~/.cargo/bin/iphone-control```diff --git a/website/en/deploy/source.md b/website/en/deploy/source.mdindex 471d9ec..f6e3dd3 100644--- a/website/en/deploy/source.md+++ b/website/en/deploy/source.md@@ -10,7 +10,7 @@ After a release, [Releases](https://github.com/Derrors/iphone-control/releases)```bashsudo apt install usbmuxd-tar xzf iphone-control-v*-x86_64-unknown-linux-gnu.tar.gz+tar xzf iphone-control-v*-x86_64*.tar.gz # on ARM, aarch64 instead of x86_64 (see uname -m)install -Dm755 iphone-control-*/iphone-control ~/.cargo/bin/iphone-control```