phone-harness README

The project's README from github.com/ShawnPana/phone-harness. As one markdown file: README.md.

Phone Harness 📱

phone-harness · let your agent control your phone.

Connect Claude Code, Codex, or any agent to your real phone. iPhone through the Mac's iPhone Mirroring window, Android over adb from macOS, Linux or Windows, or a Phone Harness Cloud phone — an Android over adb, or an iPhone over HTTPS. No jailbreak, no Xcode, nothing installed on the phone. The agent sees the screen, taps, types, and reads the result.

  ● agent: wants to open Weather
  │
  ● find_text("Weather") → (400, 468)
  │
  ● tap(400, 468) → reads the screen → forecast is up
  ✓ done

Try Phone Harness Cloud → Hosted iPhones and Androids with stealth, real numbers, 2FA, and unlimited devices

Get started by sending the setup prompt to your coding agent.

Demo

Task: "Buy me a Waymo to Delah Coffee from my current location."

https://github.com/user-attachments/assets/80b6d38e-0222-481c-93db-9de60d79247a

Setup

Paste into Claude Code or Codex:

Install or upgrade phone-harness to the latest stable version with uv using Python 3.12, register the skill from `phone-harness skill`, then read https://github.com/ShawnPana/phone-harness/blob/main/onboarding.md and walk me through it. Follow https://github.com/ShawnPana/phone-harness/blob/main/install.md if setup or connection fails.

The agent asks which phone is your default and walks you through the parts that need your hands: pairing iPhone Mirroring and granting Accessibility and Screen Recording, or turning on Android developer options and approving adb. It also offers a cloud Android — the same helpers with nothing to pair, and the first 100 minutes free — so an iPhone user can test on Android too. phone-harness --doctor checks the chain. Details in install.md.

Hermes Agent: hermes plugins install ShawnPana/phone-harness/integrations/hermes adds a phone_exec tool and this skill. See integrations/hermes.

Usage

phone-harness <<'PY'
open_app("Notes")
tap_text("New Note")
type_text("hello from the harness")
print([o["text"] for o in screen()][:10])
PY
phone-harness --version

phone-harness --version (or -V) prints phone-harness <version>.

Helpers are pre-imported. SKILL.md is the agent's day-to-day guide; helpers.py is the full list. Task-specific helpers live in ~/.phone-harness/agent-workspace (see install.md). The first run creates that folder from the packaged defaults and never overwrites an existing one. Delete the folder for a fresh default; the next run recreates it. A checkout uses its own agent-workspace/ instead.

No phone on your desk? Rent one

phone-harness cloud login            # once: approve in your browser
phone-harness cloud ls               # phones on the account, and any live session
phone-harness cloud start            # cloud.phone if set, else a temporary Android; 15 min (--for 90s, 15m)
phone-harness cloud start ios        # the account's iPhone, when only one is listed
phone-harness <<'PY'
print(screenshot())
PY
phone-harness cloud stop             # billing stops; a saved Android is written back

cloud ls is the catalog (GET /me → available): each phone's label, platform, and id, with a live session on that row (matched by device id, profile id, or the temporary row). A cloud iPhone session does not echo its catalog id (device is the word "iPhone", and profile is an iphone-… id that matches no catalog row). That session is written on the one catalog row of the same platform and kind whose state is running, when that is the only such row and the only unmatched session of that platform and kind. A session that matches nothing is its own row. cloud start with no name starts this machine's cloud.phone setting if one is set, else what the service gives an unnamed start, a temporary Android. A name is a catalog id or label, or ios / android when only one entry has that platform. A cloud Android is reached over adb, so every helper works on it unchanged. A cloud iPhone has no shell: the helpers POST ops over HTTPS, OCR runs on the host, and driving it is in SKILL.md. phone-harness cloud lists the rest, including watch, open, history, and phone for the saved Android. --session SID (or PHONE_HARNESS_SESSION) pins one rented phone for this process.

Updates

phone-harness update upgrades a uv tool (uv tool upgrade phone-harness) or a git checkout (git pull --ff-only). Any other install prints pip install -U phone-harness and leaves it for you to run. The tool never updates itself. On a terminal, once a day, it prints one line on stderr when PyPI has a newer version. Set PHONE_HARNESS_NO_UPDATE_CHECK=1 to silence that notice.

How it works

iPhone. iPhone Mirroring renders the phone as a Mac window and forwards mouse and keyboard as touches. The harness captures that window, OCRs it with Apple's Vision framework for text with tap-ready coordinates, and posts HID-level events for taps, swipes, and typing.

Android. adb is the transport. screencap is the capture, the phone's accessibility tree is the text source, input is the hands. Works over USB or Wi‑Fi, no window needed.

Cloud iPhone. phone-harness cloud start with that phone's catalog id, label, or ios when it is the only one, drives it over HTTPS from any OS. The host runs OCR; taps use the phone's screen points. No adb and no accessibility tree. Day-to-day steps are in SKILL.md.

Same helpers throughout. phone-harness config set platform ios|android picks the desk default.

Limits

Sponsor

phone-harness is free and maintained in my own time. Sponsoring keeps it that way.

phone-harness (ShawnPana/phone-harness)

Searching Database…

这是干什么的?Phone Harness 让 Claude Code 或 Codex 这类 AI 编程助手控制一台真实的手机——iPhone 通过 Mac 的 iPhone Mirroring 窗口,Android 通过 adb,也可以用租来的云端手机——全程无需越狱,手机上也不用安装任何东西。
它是一个命令行工具,还是要在手机上装东西?它是一个在你电脑上运行的命令行工具,用来远程观察和操作手机的屏幕;助手能看到屏幕、点击、输入并读取结果,手机本身什么都不用装。
我怎么把它跑起来?你把配置提示词发给你的编程助手(Claude Code 或 Codex),它会问你的默认手机是哪台,然后带你一步步完成配对——iPhone 需要开启 iPhone Mirroring 并授予辅助功能和屏幕录制权限,Android 则需要开启开发者选项并通过 adb 授权。
控制 iPhone 必须有 Mac 吗?是的——iPhone 的控制要通过 Mac 的 iPhone Mirroring 窗口,所以这条路需要 macOS;而通过 adb 控制 Android 在 macOS、Linux 或 Windows 上都可以。
它做不到什么?设置了 PIN 锁的手机,以及镜像过程中解锁 iPhone,仍然需要你亲手操作;OCR 只能识别带文字标签的内容,纯图标控件需要能看图模型支持;另外不支持多点触控、摄像头和 Face ID,受 DRM 保护的视频画面会显示为黑屏。
Phone Harness Cloud 是什么?它是一项托管租用服务,提供真实的 Android 和 iPhone 设备,无需配对,支持隐身模式、真实手机号、双因素验证(2FA),设备数量不限,前 100 分钟免费。
助手实际上是怎么看到手机屏幕上的内容的?iPhone 方面,它会截取 Mirroring 窗口,并用 Apple 的 Vision 框架跑 OCR,得到可以直接点击的文字坐标;Android 方面,它使用 adb 的 screencap 和无障碍树(accessibility tree),然后以 HID 或 adb 输入事件的方式发送点击和输入。
它只能配合 Claude Code 和 Codex 使用吗?不是,它的设计目标是兼容任何编程助手,还有一个专门的 Hermes Agent 集成,可以用 'hermes plugins install ShawnPana/phone-harness/integrations/hermes' 安装。
Creator
ShawnPana
Size
0.9 MB
Stars
3.7K
Age
2mo
Commits · 90 Days