gitwtfhub

wtf is phone-harness?

shawnpana/phone-harness — explained in plain English

Analysis updated 2026-08-13

1,699PythonAudience · developerComplexity · 3/5Setup · moderate

TL;DR

Phone Harness lets an AI agent control a real iPhone through the Mac's iPhone Mirroring feature, using screenshots and OCR to see and simulated taps to act.

Mindmap

mindmap
  root((phone-harness))
    What it does
      Agent controls iPhone
      Uses Mac mirroring
      No jailbreak needed
    Tech stack
      Python
      Vision framework
      CGEvents
    Use cases
      Agent driven testing
      Phone automation
      OCR based interaction
    Audience
      Developers
      AI agent builders
    Limits
      One phone only
      No multi touch
      No Face ID

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Let an AI coding agent open apps and interact with a real iPhone for testing

REASON 2

Automate repetitive phone tasks by scripting taps, typing, and scrolling

REASON 3

Verify a phone app's behavior by having an agent read on-screen text via OCR

REASON 4

Demo or test iOS app flows without jailbreaking the device or using Xcode tooling

What's in the stack?

PythonmacOSVision frameworkCGEvents

How it stacks up

shawnpana/phone-harnessvasu-devs/justhiremejuneyaooo/nihaisha-nishi-tcm
Stars1,6991,7031,704
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedevelopervibe codergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires macOS Sequoia or newer, iPhone Mirroring paired once, and terminal Accessibility and Screen Recording permissions.

Wtf does this do

Phone Harness lets an AI agent like Claude Code or Codex actually control a real iPhone through your Mac, without jailbreaking the phone or installing any special developer tools on it. It works by taking over the Mac's built-in iPhone Mirroring window, which shows your phone's screen live and forwards mouse and keyboard input to it as real touches. The agent sees the phone by taking a screenshot of that mirroring window and running Apple's Vision framework on it to read every piece of visible text along with its exact screen position, similar to how a web agent might read a page's structure. It acts on the phone by sending low-level input events, taps, long presses, drags, scrolls, and typed text, directly to that same window. After acting, it takes another screenshot to confirm the change actually happened, since there is no other way to inspect the phone's state. Setting it up mostly means running a guided prompt inside an agent like Claude Code, which walks you through cloning the project, installing it as a command, and registering it so the agent automatically reaches for it. Two steps require you personally: pairing iPhone Mirroring with your physical phone once, and granting the Mac's terminal permission for Accessibility and Screen Recording in System Settings. A built-in doctor command checks that everything is connected correctly. The project is honest about what does not work. Older automation approaches like AppleScript clicks are silently ignored because the mirrored window has no accessibility information, only a video feed. Typed text has to use raw keyboard codes rather than Unicode characters, slow drags barely register on iOS lists so scrolling needs a proper flick or wheel gesture, and input is ignored if the mirroring window is not the frontmost window on screen. It has real limits too: only one phone and one session at a time, no multi-touch gestures like pinching, no camera or Face ID flows, and DRM protected video shows up as a black screen since it cannot be captured.

Yoink these prompts

Prompt 1
Set up phone-harness for me and connect it to my real iPhone through iPhone Mirroring
Prompt 2
Walk me through granting Accessibility and Screen Recording permissions for phone-harness
Prompt 3
Write a phone-harness script that opens Notes, taps New Note, and types a message
Prompt 4
Explain why AppleScript clicks and Unicode typing do not work with phone-harness
Prompt 5
What are the current limits of phone-harness, like multi-touch and camera support?

Frequently asked questions

wtf is phone-harness?

Phone Harness lets an AI agent control a real iPhone through the Mac's iPhone Mirroring feature, using screenshots and OCR to see and simulated taps to act.

What language is phone-harness written in?

Mainly Python. The stack also includes Python, macOS, Vision framework.

How hard is phone-harness to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is phone-harness for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.