What if your coding agent could use a phone?
phonedriver: giving coding agents an Android phone or iPhone without burning tokens
- Runs on
- macOS, Linux and Windows (Android and iOS)
- Status
- Open source
- First released
- Updated
Most of what lives on a phone has no API. If you want a coding agent to test your app’s signup screen, change a setting buried three menus deep, or check why a button breaks on a real device, you still end up tapping through it yourself or feeding the model heavy screenshots one turn at a time.
I built phonedriver in Rust so Claude Code, Codex, Cursor or any MCP client can use an Android phone or iPhone directly. In the demo I shared on r/ClaudeAI and r/ClaudeCode, Claude opens dominos.co.uk on an Android phone, finds the shop nearest Leicester Square, fills the basket and guest checkout, taps Buy with GPay, and stops to ask before spending anything. Those posts took the repository to around 450 stars on GitHub.

Reading a phone as text, not pictures
Sending screenshots on every step burns through an agent’s token limit quickly and still forces the model to guess pixel coordinates. Instead, phonedriver reads the screen as a short numbered list of things a thumb can touch or an eye needs to read. When the agent taps a switch, phonedriver waits until the animation settles and sends back only what changed:
$ phonedriver tap @e24
ok tapped @e24 "Dark theme"
~ @e23 button "Dark theme" "Will turn on when Bedtime starts" → "Will never turn off automatically"
~ @e24 switch "Dark theme" off → on+ means a line appeared, - means it left, and ~ means it changed. On a real phone’s Display settings page, Android’s built-in screen dump spits out 25 KB of raw XML; phonedriver trims that down to 461 bytes by dropping off-screen elements, merging labels onto clickable buttons, and folding the whole on-screen keyboard into a single line.
Standard adb also starts cold on every read, taking over two seconds on an emulator and sometimes timing out completely on busy screens. Borrowing a trick from scrcpy, phonedriver pushes a tiny helper to Android over adb and keeps it warm while your agent works, with no app to install and nothing left behind afterwards. Screen reads drop from 2.2 seconds to 13 milliseconds, and a lightweight video stream lets phonedriver watch the pixels settle instead of guessing with fixed pauses.
A few real mobile quirks shaped the rest. Scroll a long Android list and the system quietly recycles row IDs from the top of the screen to the bottom, so phonedriver re-checks every button’s role and label before tapping instead of clicking the wrong row. On the iOS Simulator, I opened Xcode’s cache folder during profiling and found it had quietly filmed 154 QuickTime movies (1.2 GB) of my test sessions before I turned screen recording off.
Fewer tokens on real jobs
I tested phonedriver on nine real phone jobs on the same Android emulator with Claude Sonnet 5.5 against two other MCP servers: changing Chrome’s search engine, cropping a photo, pinning and archiving Messages threads, hunting planted bugs in a signup form, and tracking down an app draining the battery. A script checked the phone’s own app data afterwards rather than trusting the model’s word:
| Tool | Runs passed | Total tokens | Wall time |
|---|---|---|---|
| phonedriver | 27 / 27 | 658k | 5.1 min |
mobile-mcp |
17 / 18 | 4.6M | 8.7 min |
phone-harness |
14 / 18 | 1.1M | 22.7 min |
phonedriver used 6.9x fewer tokens than mobile-mcp and finished in roughly half the time. On the iOS Simulator, simulator-use still beats phonedriver on raw typing speed because its shortcuts hide the on-screen keyboard. When I tried low-level hardware keystrokes, they landed in under 10 ms and quietly turned [email protected] into gary2mail.com, so phonedriver keeps typing the slower, exact way an iPhone does.
Once an agent figures out a flow, you don’t have to pay for a model to run it again. phonedriver save records the session into a .steps file that phonedriver replay runs in CI with zero tokens (109 of 110 runs passed across 11 Android jobs). On Android 13 and later, agents can also work on a hidden second screen so your own phone stays usable, or share one device across separate hidden screens.
Asking before it pays
Whenever an action targets a payment or delete-account button (matching labels across 11 languages, like Pay, Buy with GPay, Place order or Delete account), phonedriver holds the tap and opens an approval prompt straight inside Claude Code. The model never sees that prompt and cannot answer for you. Password and one-time-code fields also reject plain text, keeping secrets out of logs and saved replays.
What’s still rough
The payment guard reads button text, so an icon-only Pay button or an uncovered language can slip past it. Apps that hide their controls from the system (games, custom canvases, WeChat) fall back to reading text straight from the pixels, which is slower and less exact than native screen trees.
Real iPhone taps take around half a second compared with 30 to 40 ms on an Android emulator, and Apple’s free signing expires every seven days (macOS re-signs the helper automatically; on Windows, Sideloadly handles USB and Wi-Fi control with no Mac, contributed by Coreho). phonedriver never enters passcodes or passes Face ID on a real phone, and it sends no telemetry.
Try it
Add phonedriver to Claude Code, Codex, Cursor, VS Code and Gemini CLI in one command:
npx -y phonedriver initYou can also install the binary with Homebrew (brew install hridaya423/tap/phonedriver) or via the Claude Code plugin (claude plugin marketplace add hridaya423/phonedriver).
Site: phonedriver.dev. Benchmarks: phonedriver.dev/benchmarks. Source: github.com/hridaya423/phonedriver (AGPL-3.0). Reddit threads: r/ClaudeAI, r/ClaudeCode.