[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-94474":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},94474,"phone-harness","ShawnPana\u002Fphone-harness","ShawnPana","let your agent control your phone",null,"Python",1689,147,1,4,0,469,64.51,"MIT License",false,"main",true,[],"2026-08-24 04:01:22","# Phone Harness 📱\n\nConnect an LLM directly to your real iPhone with a thin, editable harness.\nNo jailbreak, no Xcode, no WebDriverAgent.\n\nThe Mac's iPhone Mirroring window is the whole transport: `screencapture` +\nVision-framework OCR for eyes, HID-level CGEvents for hands. Nothing between the\nagent and the phone. The agent writes what's missing during execution in\n`agent-workspace\u002Fagent_helpers.py`.\n\n```\n  ● agent: wants to open Weather\n  │\n  ● ocr() → \"Weather\" at (400, 468)\n  │\n  ● tap(400, 468) → wait_stable() → ocr() confirms the forecast\n  ✓ done\n```\n\n**Your phone, driven by an agent.**\n\n## Setup prompt\n\nPaste into Claude Code or Codex:\n\n```text\nSet up phone-harness for me. Clone https:\u002F\u002Fgithub.com\u002FShawnPana\u002Fphone-harness\ninto ~\u002F.phone-harness (its canonical home) and read `install.md` first to install\nit and connect it to my real iPhone\nthrough the macOS iPhone Mirroring app — install it so `phone-harness` is a\ncommand on my PATH, and register it as an agent skill named phone-harness using\n`phone-harness skill` as the body, so you reach for it automatically. Then read\n`SKILL.md` for normal usage, and always read `src\u002Fphone_harness\u002Fhelpers.py`\nbecause that is where the functions are. Whenever you capture or verify the\nscreen, activate the iPhone Mirroring window so I can see what you're doing on\nthe phone.\n\nSetup needs two things only I can do: pairing iPhone Mirroring with my phone\nonce, and granting the terminal Accessibility + Screen Recording in System\nSettings — walk me through those and wait for me. Verify with\n`.\u002Fphone-harness --doctor`.\n\nAfter it's installed, as a quick demo that interaction works, go to my Home\nScreen and — if the phone is connected and unlocked — ask me whether you should\nopen the Weather app as a harmless test; only open it if I say yes. If the\nsession is paused or the phone is locked, just tell me the doctor status instead.\n```\n\nThe agent will walk you through the two things only you can do: **pairing**\niPhone Mirroring with your phone once (the pairing prompts need the physical\nphone), and granting the terminal **Accessibility** (taps & keystrokes) and\n**Screen Recording** (seeing the phone) in System Settings → Privacy &\nSecurity. Screen Recording takes effect after the terminal restarts;\nAccessibility is immediate. Then `.\u002Fphone-harness --doctor` verifies the whole\nchain.\n\nThese are the permissions currently known to be required. A fresh machine may\nprompt for more the first time an action runs — if `--doctor` passes but taps or\ncapture silently do nothing, watch for a macOS permission prompt. See\n[install.md](install.md) for details.\n\n## Why this works\n\niPhone Mirroring (macOS Sequoia+) renders the phone as a Mac window and forwards\nreal mouse and keyboard input as touches. That gives an agent everything it\nneeds:\n\n- **See** — capture just the mirroring window, OCR it with Apple's Vision\n  framework: every visible string with a tap-ready coordinate. The poor man's\n  DOM.\n- **Act** — CGEvents posted at the HID tap: taps, long-presses, drags\u002Fflicks,\n  scroll gestures, unicode typing, and the app's own shortcuts (Cmd+1 Home,\n  Cmd+2 App Switcher, Cmd+3 Spotlight).\n- **Verify** — screenshot again. No DOM means the capture is the ground truth.\n\nThings that do NOT work, learned the hard way: AppleScript `click at` (silently\nignored — the window is a video stream with no accessibility tree), unicode key\npayloads (mirroring forwards raw HID keycodes, so typing must use keycodes), a\nslow touch-drag (barely moves an iOS list — use wheel scroll for lists, a fast\nflick for pages), and input while the window isn't frontmost (swallowed).\n\n## Usage\n\n```bash\n.\u002Fphone-harness \u003C\u003C'PY'\nopen_app(\"Notes\")\ntap_text(\"New Note\")\ntype_text(\"hello from the harness\")\nprint([o[\"text\"] for o in ocr()][:10])\nPY\n```\n\nDay-to-day workflow lives in [SKILL.md](SKILL.md), which [install.md](install.md)\nregisters as an agent skill (`phone-harness skill` prints the body) so the agent\nreaches for it on its own.\n\n## Architecture\n\n- `SKILL.md` — day-to-day usage (the agent-facing product surface)\n- `install.md` — permissions bootstrap and troubleshooting\n- `src\u002Fphone_harness\u002F` — protected core (~500 lines):\n  - `mirror.py` — window discovery, focus, capture, CGEvent input\n  - `ocr.py` — Vision-framework text recognition → screen-point boxes\n  - `helpers.py` — the primitives pre-imported into scripts\n  - `admin.py` — `--doctor`\n  - `run.py` — the CLI (`exec` stdin with helpers in scope)\n- `agent-workspace\u002Fagent_helpers.py` — helper code the agent edits; auto-loaded\n  into every script's namespace\n\nThe mirror transport is stateless (window bounds and captures are re-queried per\ncall), so there is no daemon — every invocation is self-contained.\n\n## Development\n\nFrom a checkout, use `.\u002Fphone-harness` to run the working tree directly:\n\n```bash\n.\u002Fphone-harness \u003C\u003C'PY'\nprint(screen_info())\nPY\n```\n\n## Limits\n\n- One phone, one session; unlocking the physical phone pauses mirroring.\n- No multi-touch (no pinch), no camera\u002FFace ID flows, DRM video renders black.\n- OCR sees text, not semantics — unlabeled icons need a screenshot + a\n  vision-capable model.\n","Phone Harness 是一个让大语言模型（LLM）直接控制真实 iPhone 的轻量级自动化工具。它基于 macOS Sequoia 的原生 iPhone 镜像功能，通过截取镜像窗口画面并调用 Vision 框架进行 OCR 识别界面元素，再利用 CGEvents 实现系统级触控操作，全程无需越狱、Xcode 或 WebDriverAgent。核心特点是零中间层、权限最小化（仅需 Accessibility 和 Screen Recording）、操作可观察可调试。适用于 LLM 智能体在真实 iOS 设备上执行任务自动化场景，如应用启动、信息查询、跨设备协同验证等需要真实交互反馈的测试与辅助任务。",2,"2026-08-10 02:30:02","CREATED_QUERY"]