Set up the machine the agent runs on
Once per machine — a laptop, a CI runner, a sandbox image. Works on macOS, Linux and Windows.Sign in once
Let the agent start the phone
That is the whole setup. The agent starts, drives and stops your phone with three commands, which the skill already teaches it:cloud start connects the phone over ADB and unlocks it itself; every helper then drives it with nothing exported. It is the same phone each time: apps and logins are kept between sessions. phone-harness cloud shows what is running and how long is left, cloud watch reopens the read-only live view, and cloud open opens the dashboard when you want to take the controls yourself — to type a password, say.
Give the agent this prompt
One phone per agent, programmatically
For an agent service, split the work in two. An orchestrator holds an API key and never touches phones:host, port and code, and runs the connection at startup — no account of its own:
timeout_seconds is the backstop. Reconnecting is safe to repeat: after a dropped connection, run adb connect and unlock again with the current code.
Notes
- Serial, not identity.
live.phone-harness.com:22220belongs to a phone only while its session lives; the session id is the stable name. - Reconnects need
unlockagain. Everyadb connectis a new connection;cloud starthandles this for its own phone. - Plaintext. ADB over TCP is not encrypted; do not send secrets through
adb shellyou would not send in the clear. - Appium / uiautomator2 / scrcpy use the same
host:portas their serial orudidafter the unlock.