How shawnpana/phone-harness works
Phone Harness lets an agent operate a physical iPhone through macOS iPhone Mirroring or an Android device over adb, with an optional rented cloud Android. The main workflow is a script sent to the CLI, which exposes helpers that dispatch platform-neutral operations to a backend; the backend captures the screen and sends input, then returns text or other results. Cloud session management and device configuration are separate supporting flows. Some source excerpts are partial, so the graph includes only documented or directly supported wiring.
Main entry points: transport.py Operation dispatch · ios.py iPhone backend · cloud.py Cloud sessions · admin.py Diagnostics
Components 16
Agent runtime
- CLI runner
src/phone_harness/run.py - Phone helpers
src/phone_harness/helpers.py
Control backends
- Operation dispatch
src/phone_harness/transport.py - iPhone backend
src/phone_harness/ios.py - Android backend
src/phone_harness/android.py - Mirroring transport
src/phone_harness/mirror.py - Background control
src/phone_harness/background.py - Vision OCR
src/phone_harness/ocr.py
Device provisioning
- Cloud sessions
src/phone_harness/cloud.py
Support services
- Configuration
src/phone_harness/config.py - Diagnostics
src/phone_harness/admin.py - Telemetry
src/phone_harness/telemetry.py
Other components
- Agent
- Connected phone
- Phone Harness Cloud
- ADB
Connections 21
- Agent → CLI runner: runs scripts
- CLI runner → Phone helpers: loads helpers
- CLI runner → Telemetry: records events
- Phone helpers → Operation dispatch: sends operations
- Operation dispatch → Configuration: reads platform
- Operation dispatch → Cloud sessions: checks attachment
- Operation dispatch → iPhone backend: dispatches operations
- Operation dispatch → Android backend: dispatches operations
- iPhone backend → Mirroring transport: uses transport
- iPhone backend → Background control: selects control path
- iPhone backend → Vision OCR: recognizes captures
- Mirroring transport → Connected phone: sends input, captures screen
- Background control → Connected phone: sends input, captures screen
- Android backend → ADB: runs device commands
- ADB → Connected phone: controls device
- Cloud sessions → Phone Harness Cloud: manages sessions
- Cloud sessions → ADB: connects rented phone
- Cloud sessions → Configuration: reads and writes state
- Diagnostics → Configuration: checks settings
- Diagnostics → iPhone backend: checks readiness
- Diagnostics → Android backend: checks readiness