AIFeed

Show HN:Turbotap —— 让 AI 智能体通过 Wi-Fi 操控 iPhone 的开源 CLI

Translation(model translation, not the source's own text)

turbotap

通过 Wi-Fi 在终端或 AI agent(Claude Code、Codex、OpenClaw)中驱动真实 iPhone 的快速 CLI。

点击观看这段 39 秒的演示:通过 Wi-Fi 在真实 iPhone 上操作(设置、Spotify、天气和 App Store)。

turbotap 演示:一个 agent 通过 Wi-Fi 在真实 iPhone 上操作设置、Spotify、天气和 App Store
turbotap 演示:一个 agent 通过 Wi-Fi 在真实 iPhone 上操作设置、Spotify、天气和 App Store

每个 LLM 轮次只靠一张截图来驱动 iPhone 很慢:抓取一帧、等模型挑选坐标、发送一个操作,然后重复。turbotap 在一个本地 Rust 命令中,针对手机上打过补丁的 WebDriverAgent 运行一整串 UI 步骤,并返回包含屏幕上文本和交互控件的 JSON。

它做什么

以下所有数字均于 2026 年 11 月 28 日在真实 iPhone 17(iOS 26.6.2)上通过家庭 Wi-Fi 测得;完整方法、区间、版本标签和复现脚本见 docs/benchmarks.md。

  • 单命令多步流程:在一个本地 Rust 进程中批量执行点击、滚动、文本输入和读取,而不是每个 LLM 轮次截一次图。在 设置 → 通用 → 关于 → 读取 iOS 版本 这一任务上,单个流程运行的中位数为 6.9 s(5.5–15.8 s;在 v1.6.8 候选版 7d2e6cd 上 8 次中成功 5 次),而每步截图的 Claude Sonnet 循环耗时中位数墙钟时间为 22.0 s(16.1–26.8 s,6/6 成功,为另一场 v1.6.7 会话;使用 turbotap 的 agent 仍需花一个模型轮次来编写流程)。
  • 打补丁的 WebDriverAgent(wda-turbo):在 v1.6.7 上(n=6),冷启动应用(launch:APP)中位数为 175 ms(141–461 ms),原始点击(tapxy:)449 ms(400–543 ms),精确元素点击(tapel:)793 ms(723–898 ms),输入 28 个字符(type:)902 ms(876–1,001 ms)。经反应验证的标签点击(tap:LABEL,包含 iOS 过渡等待)冷启动测得 1,141 ms(1,067–1,269 ms),预热后 1,207 ms(1,148–1,406 ms,在 v1.6.8 候选版 7d2e6cd 上各 n=8)。未打补丁时自动回退到原版 WDA。
  • 双屏读取(OCR + UI 树):在 v1.6.7 上(n=6),组合读取(OCR + 交互控件)中位数为 180 ms(153–607 ms),辅助功能树(ui)142 ms(113–266 ms),200 pt 区域 OCR(read:Y0-Y1)66 ms(55–168 ms),全屏 read:ocr 492 ms(297–591 ms;在候选流程内为 183 ms,158–284 ms,n=5),设备端 Apple Vision OCR(read:vision)372 ms(338–412 ms)。
  • 面向 agent 和脚本的单一独立二进制:无 Python 运行时,内置 agent skills(turbotap install-skill),步骤级计时回执(turbotap timings --receipt),以及可选的预热守护进程(--daemon,将单独的 turbotap ocr 调用从 237 ms(177–401 ms)降至中位数 148 ms(122–295 ms),v1.6.7,各 n=10)。

示例


        # Open the App Store, search "Angry Birds", tap Get, and wait until Open appears
turbotap flow --timeout 90 open:com.apple.AppStore tap:Search 'search:Angry Birds' 'tap:Angry Birds 2' tap:Get waitcontrol:Open

# Open Spotify -> Your Library -> Liked Songs, read the list, and swipe back
turbotap flow open:Spotify 'tap:Your Library' 'tap:Liked Songs@y>150' wait:songs read:ocr back

# Open Weather and read the forecast
turbotap flow open:Weather read

# Open Settings -> General -> About and read the iOS version
turbotap flow launch:com.apple.Preferences scrollto:General tap:General tap:About 'wait:iOS Version' read

# Draft a Messenger reply to Alice while blocking Send and Call buttons
turbotap flow --deny-also 'Send|Call' open:Messenger 'tap:Alice@y>300' 'fill:Message=On my way' read

# Read a 2FA code directly from Authenticator's accessibility tree
turbotap flow open:Authenticator readel:GitHub
      

运行 turbotap flow --help 或查看 docs/REFERENCE.md 了解每个步骤(弹窗、表单、开关、滑块、选择器、Vision OCR、区域过滤器和正则表达式)。

环境要求

  • 一台 iPhone(iOS 17+),连接本地 Wi-Fi,并已启用开发者模式和 UI 自动化。

文章标题:Show HN: Turbotap —— 用于 AI 智能体通过 Wi-Fi 操控 iPhone 的开源 CLI

正文:

  • 一台装有 Xcode 的 Mac,用于在手机上签名并启动 WebDriverAgent(Apple 要求使用 Xcode;免费的 Apple ID 即可,付费开发者账号可获得更长的 provisioning 有效期)。一旦 WDA 运行起来,turbotap 就会从该 Mac 或同一网络上的任意 Linux 机器通过 Wi-Fi 直接与手机通信。
  • Tesseract(可选)用于本地 OCR。turbotap 在运行时加载 libtesseract;未安装时,ui 和 on-device read:vision 仍然可用。

安装与快速开始

1. 安装 turbotap

从 GitHub Releases 安装适用于 Apple Silicon macOS 或 Linux x86-64(glibc 2.39+)的、经过校验和验证的预编译二进制文件,或使用 Cargo 从源码构建:


        # 预编译二进制文件(下载最新发布版本,验证 SHA-256,安装到 ~/.local/bin/turbotap)
curl -fsSL https://raw.githubusercontent.com/Maxteabag/turbotap/main/scripts/install.sh | sh

# 或从源码构建(需要 Rust 工具链)
cargo install --git https://github.com/Maxteabag/turbotap.git

# 为 Claude Code、Codex、OpenClaw 等安装内置技能
turbotap install-skill
      

可选的本地 OCR(Tesseract):


        brew install tesseract                              # macOS
sudo apt install libtesseract5 tesseract-ocr-eng    # Ubuntu / Debian
sudo pacman -S tesseract tesseract-data-eng         # Arch Linux
      

2. 配置你的 iPhone

在 iPhone 上,开启开发者模式(设置 -> 隐私与安全性 -> 开发者模式)和 UI 自动化(设置 -> 开发者 -> 启用 UI 自动化)。记下它的 Wi-Fi IP(设置 -> Wi-Fi -> (i))和 UDID(在 Mac 上运行 xcrun devicectl list devices)。

创建 ~/.config/turbotap/config.json:


        {
  "default_device": "iphone",
  "mac_host": "mac",
  "team_id": "YOUR_APPLE_TEAM_ID",
  "bundle_id": "com.yourname.wda",
  "passcode_cmd": "your-secret-manager get iphone-passcode",
  "stop_file": "~/turbotap.stop",
  "devices": {
    "iphone": {
      "url": "http://192.168.1.50:8100",
      "udid": "000081XX-XXXXXXXXXXXXXXXX",
      "allowed_apps": ["com.apple.weather", "com.apple.Preferences"]
    }
  }
}
      

3. 部署 WDA 并运行流程


        turbotap deploy       # 克隆、打补丁、构建并在 mac_host 上启动 WDA(--no-build 仅重启)
turbotap preflight    # 检查锁定状态、前台应用和采集健康状况
turbotap unlock
turbotap flow open:Weather read
      

完整操作指南(查找你的 Team ID、信任开发证书、SSH 签名钥匙串、多台手机、故障排除)见 docs/SETUP.md。

安全

  • 终止开关(stop_file):创建你配置的 stop_file(或 TURBOTAP_STOP_FILE)会立即以退出码 6 停止所有变更类命令——包括在流程中途、下一次输入之前。删除该文件即可恢复。
  • 应用守卫(allowed_apps):将输入限制在 bundle ID 允许列表内,每次输入请求前通过 /wda/activeAppInfo 实时检查(出错或未知应用时按失败关闭处理;除非显式限定范围,否则拒绝 url:)。
  • 拒绝过滤器(--deny、--deny-also、deny_also):阻止与你提供的正则表达式匹配的点击、开关、滑块以及键盘 Return/换行(例如在 config.json 中设置 "deny_also": ["Send|Post|Pay|Buy|Delete"])。
  • 未经许可绝不按下发送/发布:内置的智能体技能指示智能体在草稿阶段停下,并在发送、发布、支付或删除之前要求明确批准;将其与 deny_also 配合使用,以在代码层面强制执行该边界。
  • 凭据始终被打码:密码(passcode_cmd)、PIN 码(pintap:env:/cmd:)和口令(fill:FIELD=env: / cleartype:env:)在本地获取,直接写入已验证的目标字段,并从输出、错误和计时日志中清除——包括在启用打码作用域(TURBOTAP_REDACTION_DIR + TURBOTAP_REDACTION_KEY)时跨多次 CLI 调用。

完整安全模型、设备固定规则以及跨调用打码的详细信息见 docs/SAFETY.md。

文档

  • docs/SETUP.md —— Mac/Xcode 签名、SSH 钥匙串、多台手机、故障排除

Show HN: Turbotap —— 让 AI Agent 通过 Wi-Fi 操控 iPhone 的开源 CLI

  • docs/REFERENCE.md —— 完整的 CLI 子命令、流程步骤、时序回执、常驻守护进程、环境变量
  • docs/SAFETY.md —— 停止文件、应用守护、拒绝模式、凭据处理、跨调用脱敏
  • docs/benchmarks.md —— 全新 iPhone 17 基准测试(中位数、范围、版本对比、复现脚本)
  • docs/HOW_IT_WORKS.md —— 架构、wda-turbo.patch 端点、剥离式并行 OCR、零动量滚动
  • skills/turbotap/SKILL.md & skills/turbotap-retro/SKILL.md —— 为 Claude Code、Codex 和 OpenClaw 捆绑的技能

License

MIT。见 LICENSE。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗