Skip to content

0.2.0 — Android

Latest

Choose a tag to compare

@ShawnPana ShawnPana released this 18 Aug 02:21
· 19 commits to main since this release

pip install phone-harnesshttps://pypi.org/project/phone-harness/0.2.0/

Android

Drive a real Android phone the same way you drive an iPhone — same helpers, same agent code. Pure adb: screencap for eyes, the phone's own accessibility tree for exact text and boxes (ocr() is exact here; tap_ui("url_bar") finds what OCR can't), input for hands, back() exists. USB (plug in, tap Allow) or Wi‑Fi (phone-harness android pair CODE — the phone is found over mDNS; only the 6‑digit code crosses). Paired phones are remembered by name and reconnected automatically. A locked phone is refused honestly (locked), never PIN'd. phone-harness android awake keeps the phone unlocked for a session without changing a setting, with a live scrcpy mirror if installed; rest puts it to sleep. phone-harness --doctor android. (#39, #40)

The seam

Every device sits behind one send(op, **kw) vocabulary (transport.py); helpers are platform-agnostic; connect("ios"|"android"). This is what made Android one file. (#19)

iPhone reliability

Window discovery by PID, focus tracking that reflects reality, and dead-session detection that is structural — interstitials ("iPhone in Use", "Connect", "Mac Locked") are recognised by shape, quoted verbatim, and never tapped through. (#18)

Interactivity

type_text pastes by default (exact, no autocorrect); keystrokes=True for real key events; real modifier chords. The typed text stays on the clipboard — restoring the previous clipboard raced the phone and could paste it instead. (#20, #43)

Config

phone-harness config — settings with their source; config set platform android makes Android the default; remembered devices in ~/.local/state/phone-harness. Precedence: argument → env → file → default. (#40)

Onboarding

One short setup prompt (README and phone-harness.com); the guided first-run flow lives in onboarding.md; install.md covers both phones. (#44)

Also

--doctor [ios|android] and two long-standing doctor bugs (verdict, capture crash) fixed; SKILL.md covers both platforms; phone-harness skill works from an installed wheel; PyPI publishing on tag via trusted publishing (0.1.1 was the first PyPI release).

Known limits (stated, not hidden)

Android's tree costs seconds on a slow phone and is unavailable on screens that never go idle (read the screenshot); input text is ASCII; a PIN-locked phone needs the user. The cloud backend (#42) is not in this release.

What's Changed

  • iOS reliability: window discovery, focus tracking, and dead-session detection by @ShawnPana in #18
  • Put every device behind one send() seam by @ShawnPana in #19
  • Interactivity: real modifier keys, and paste instead of typing by @ShawnPana in #20
  • Drive a cloud-rented iPhone through connect("cloud") by @ShawnPana in #21
  • config.py: one owner for settings and remembered devices by @ShawnPana in #40
  • Drive an Android phone through connect("android") by @ShawnPana in #39
  • README: setup-prompt demo stars the repo instead of opening Weather by @ShawnPana in #14
  • fix: paste never restores the clipboard early; doctor for both platforms by @ShawnPana in #43
  • docs: onboarding for two phones — one question, then only the steps that need hands by @ShawnPana in #44

Full Changelog: 0.1.1...0.2.0