phonepilot
Drives real Android devices and emulators over ADB: takes screenshots, reads the UI hierarchy, taps, swipes, long-presses, enters text, presses keys, goes back, and launches apps, all from natural-language instructions or agent-driven steps.
Shown driving the Google Maps app on a device to set up driving routes and calculate total travel durations as part of a multi-app automation workflow.
Shown opening the YouTube app on a device and playing a requested song, as part of a cross-app automation workflow.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@phonepilotOpen the Settings app and turn on Bluetooth"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fork notice. PhonePilot is a renamed, modified fork of google/artemis (Apache License 2.0). It is not affiliated with or endorsed by Google. See NOTICE for what changed. Screenshots and diagrams under
docs/assets/are from upstream and still show the original ARTEMIS name.
Key Highlights
Cross-App Automation: Executes testing workflows and everyday tasks on Android from natural language instructions.
Multimodal Targeting: Uses element indices when available, with coordinate and visual locating fallbacks for custom interfaces.
IDE Diagnostics: Model Context Protocol (MCP) integration lets Antigravity, Claude Code, and Windsurf drive test devices and collect Logcat output and screenshots.
Flash Execution: A reactive observe-and-act loop with asynchronous history summaries, typically 3–5s per step.
Pro Exploration: Checks targets before individual actions and returns blocked actions to the Operator for recovery. Supports long-running exploratory and stability tests.
Key-free Claude Code mode: the
phonepilot-directMCP server lets Claude Code look at screenshots and drive the phone itself, so no separate model API key is needed (see below).AndroidWorld Results (upstream): ARTEMIS reported 99%+ task completion on Google Research's AndroidWorld benchmark with Gemini models; not re-measured for this fork.
Related MCP server: Android ADB MCP Server
Antigravity × PhonePilot: Autonomous Testing Workflow
Antigravity uses PhonePilot through MCP to turn a test request into a plan, device execution, and a diagnostic report:
Quick Start
Ensure an Android device (with USB Debugging enabled) or emulator is connected. The one-click startup script will automatically:
Install System Toolchains: Detect and auto-install ADB, scrcpy, FFmpeg, and Python (
uv) dependencies.Mount Global MCP Server & AI Agent Rules: Prompt to automatically install global MCP configurations and the PhonePilot Mobile Testing Mindset (
rules.md) into your AI IDEs (Antigravity, Cursor, Claude Code, Codex, Windsurf, VS Code, Cline/Roo, OpenClaw).
macOS and Linux
# 1. Clone repo & navigate to directory
git clone https://github.com/google/artemis.git && cd phonepilot
# 2. One-click launch
./start.shWindows PowerShell
# 1. Clone repo & navigate to directory
git clone https://github.com/google/artemis.git
cd phonepilot
# 2. One-click launch
.\start.batPowerShell does not search the current directory for executable scripts by default, so use
.\start.batwithout a trailing\. In Command Prompt (CMD), usestart.batinstead.
Tip: Opens
http://localhost:8000in your default browser with a device connection wizard, live screen mirroring, prompt sandbox, and execution replays. You can also run directly from CLI:uv run phonepilot run "Open Settings, find Battery and tell me current level" --profile flash.
Use with Claude Code (no API key)
PhonePilot ships two MCP servers. Install both into Claude Code with one command:
uv run phonepilot mcp --install claudeServer | What drives the phone | Needs a model key? |
| Claude Code itself. Tools: | No. Uses your Claude Code session. |
| PhonePilot's own planner/operator agent ( | Yes (Gemini, OpenAI, Anthropic, ...). It runs in a separate process, which cannot borrow Claude Code's login. |
With phonepilot-direct, prompt Claude Code in plain language, for example: "Take a screenshot of the phone, open Settings, find Battery and tell me the level." Claude looks at each screenshot, picks the next tap, and repeats. It is slower per step than the Flash profile and has none of the Pro planner's verification, but it needs no extra account.
Requirements: an Android device or emulator with USB debugging on, and adb on your PATH. Restart Claude Code after installing so the tools load.
PhonePilot includes a native Model Context Protocol (MCP) server. Connect your real phone directly into AI IDEs:
1. One-Click Auto Install (Recommended)
Running ./start.sh (macOS/Linux) or .\start.bat (Windows PowerShell) will prompt you to configure global MCP and testing rules for detected IDEs (or you can install/update anytime later manually using the commands below):
# Auto-install MCP server & global rules for Antigravity / Jetski:
uv run phonepilot mcp --install antigravity
# Or install for all supported AI IDEs (including Codex):
uv run phonepilot mcp --install allTip: You can also configure MCP interactively during first-time setup via
uv run phonepilot init. Pro Tip: If you want to use thephonepilotcommand globally withoutuv runin any directory, runuv tool install -e .once in the project root.
2. Manual Configuration (Optional)
If you prefer to configure manually, run uv run phonepilot mcp --generate-config <client> (for example, codex or antigravity) to output the appropriate TOML or JSON snippet. Replace /path/to/phonepilot with your actual repo path and point command to your .venv Python executable:
Codex (
~/.codex/config.toml):
[mcp_servers.phonepilot]
command = "/path/to/phonepilot/.venv/bin/python"
args = ["-m", "mcp_server"]
cwd = "/path/to/phonepilot"
[mcp_servers.phonepilot.env]
PYTHONUNBUFFERED = "1"
PYTHONPATH = "/path/to/phonepilot"Antigravity (
~/.gemini/jetski/mcp_config.json):
{
"mcpServers": {
"phonepilot": {
"command": "/path/to/phonepilot/.venv/bin/python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/phonepilot",
"env": {
"PYTHONUNBUFFERED": "1"
},
"tools": {
"mobile_run_task": { "eager": true },
"mobile_manage_task": { "eager": true },
"mobile_get_device_state": { "eager": true },
"mobile_inspect_trace": { "eager": true },
"mobile_diagnose": { "eager": true }
}
}
}
}Claude Desktop (
claude_desktop_config.json):
{
"mcpServers": {
"phonepilot": {
"command": "/path/to/phonepilot/.venv/bin/python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/phonepilot"
}
}
}3. Mount Behavioral Rules for AI Agents (Highly Recommended)
To ensure your AI coding assistant acts with the rigor of a senior mobile test engineer and never hallucinates UI interactions, we provide a dedicated testing mindset rules file at mcp_server/rules.md (covering Active Exploration before coding, Flash vs. Pro routing strategy, Latency & Timing compensation, and the "Dynamic-First, Coordinate-Fallback" locator pattern).
You can mount or copy mcp_server/rules.md into your AI IDE's rule configuration:
Antigravity: Add the contents of
rules.mdto your Workspace Rules, Global Rules settings, or agent instructions.Claude Code: Run
phonepilot mcp --install claudeto install the rules to~/.claude/rules/phonepilot.md(install to exactly one location — Claude Code loads both~/.claude/CLAUDE.mdand~/.claude/rules/*.md, so duplicating the rules wastes context).Cursor: Copy the contents into
.cursorrulesor create a rule file at.cursor/rules/phonepilot.mdc.Codex: Add the contents to
~/.codex/AGENTS.md(or the activeAGENTS.override.md).Windsurf / OpenClaw: Add the rules to your workspace rules or global system prompts.
For more details on the testing mindset and MCP architecture, see the MCP Server README.
4. Prompt Your Phone in the IDE Chat
In Codex, Antigravity, or Claude Code, simply prompt:
"Build the latest changes into an APK, install it on the connected device, open the login screen with a test account, verify if there are any unexpected popups after login, and return screenshots of the final page."
Install the zero-runtime-dependency client on the development machine. ADB, agents, models, and image processing remain on the device host:
uv add "phonepilot-client @ git+https://github.com/google/artemis.git#subdirectory=packages/phonepilot-client"import asyncio
from phonepilot_client import PhonePilotClient
async def main():
client = PhonePilotClient(
"http://phonepilot-host:8000",
device_serial="emulator-5554", # optional: target specific device serial
default_profile="flash", # "flash" (fast reactive) or "pro" (deep reasoning)
)
result = await client.run(
"Open System Settings, go to 'Battery', verify battery percentage is displayed, and check for any crash dialogs.",
)
assert result.succeeded, f"Test failed: {result.error or result.status}"
print(f"✅ Test Passed! Device: {result.device_serial} | Trace ID: {result.trace_id}")
if __name__ == "__main__":
asyncio.run(main())Usage Modes
Web Visual Test Console (
uv run phonepilot ui): Real-time screen projection and interactive panel, supporting natural language test dispatch, live reasoning telemetry, action trajectories, and execution replay; manage server lifecycle anytime from any terminal usinguv run phonepilot restart,uv run phonepilot stop, anduv run phonepilot status;MCP Server: Connects Antigravity, Claude Code, Windsurf, and other MCP clients to real devices for bug reproduction and test execution;
Developer CLI (
uv run phonepilot run): Direct terminal execution for automated test cases, exploratory stability inspection, or AndroidWorld benchmarks with high-fidelity structured terminal output;Python SDK: Integrates as a standard Python library into existing automated testing frameworks (e.g., pytest) or CI/CD pipelines with strongly typed Pydantic structured outputs and assertion support.
What PhonePilot Installs on Your Phone
The first task on a device installs the PhonePilot Accessibility Helper, a small
accessibility service that reads the screen layout without taking the
UiAutomation connection. Tools using UiAutomation can suppress the helper unless
they enable FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES. You will see
a collapsed "PhonePilot test helper is running" notification and a new entry under
Settings > Accessibility; both are that helper. It listens only on the phone
itself and sends nothing elsewhere.
Pre-install it (avoids the ~3 s delay on the first task):
uv run phonepilot helper installInspect it:
uv run phonepilot helper status/uv run phonepilot doctorRemove it any time:
uv run phonepilot helper uninstallUse UIAutomator2 instead:
PHONEPILOT_HIERARCHY_BACKEND=uiautomatorin.envPrevent automatic installation:
PHONEPILOT_HELPER_AUTO_INSTALL=falsein.env
If the helper ever fails mid-task, PhonePilot falls back to UIAutomator2 and says
so in the task timeline, in mobile_manage_task status, and in the final report.
Benchmarks: AndroidWorld (SOTA 99%+)
Upstream ARTEMIS reported a 99%+ completion rate on AndroidWorld, Google Research's benchmark spanning 20+ apps and 100+ multi-step tasks, using Gemini models. That figure belongs to upstream; this fork has not re-run the benchmark, and it does not apply to the key-free Claude Code mode below.
How PhonePilot is Architected
Pre-Execution Checks and Action Bursts: Pro checks the target against the live UI tree and pixels before dispatching an individual action. Action bursts handle transient controls without waiting for another model turn.
Element Locating: Combines accessibility hierarchies and OCR with visual models for custom Canvas, Compose, and Flutter interfaces.
Shared History Compression: Flash and Pro replace older screenshots with visual summaries and compress completed steps into searchable history chunks. Context thresholds control when raw turns are replaced.
Execution Profiles: Flash vs. Pro
PhonePilot supports two execution profiles tailored for different automation requirements:
Flash Profile (
--profile flash): Fast and token-efficient reactive loop (~3–5s per step): one model observes the live screen, thinks, and acts, with no graph orchestration. Ideal for routine, deterministic UI tasks. The loop is unbounded by default (agent.flash.max_turns, 0 = unlimited) because history is compressed rather than capped: Flash shares the Pro session transcript ledger (session-relativeT+mm:ssclock, screenshots folded into visual summaries, older steps chunked into eras and recallable on demand viasearch_history/replay_steps) and can query the session recording throughvideo_analyzer. Transient UI (auto-fading control bars, toasts) is handled by chaining taps into oneclick_sequence. Limitations: No task plan or notes, no pre-execution safety net, no checkpoint verification or final report, and no ADB shell.Pro Profile (
--profile pro): A planning and verification workflow (~15–40s per step), built as a multi-agent graph. A Planner maintains a living Markdown task plan with milestones andverify/assertcheck items; the Operator executes it with the full toolset (Explorer grounding whoseflash/pro/ultratier is a user setting per profile —pro.explorer.mode/flash.explorer_modeinconfig/phonepilot.jsoncor--explorer-pro-mode— never chosen by the agent; notes, history recall, video analysis, ADB diagnostics). Every single action passes a pre-execution Safety Net (XML-first, pixel fallback), while multi-action fast-action bursts fire back to back to beat turn latency on transient UI. A blocked or failed action opens an execution incident that stays in the Operator's context until a later action succeeds, so recovery is handled by the Operator itself with no separate repair agent. A read-only Checker verifies plan checkpoints and runs an exit final review against the original goal (--verification-level:off/final(default) /checkpoints/strict), and plan milestone edits get an advisory review. Handles 100+ step long-horizon workflows,[Loop:continuous]monitoring, and an optional written report.
Roadmap
Android Studio Integration: Native IDE plugin and workflow integration to enable in-editor debugging, test recording, and automated device control directly within Android Studio.
iOS Platform Expansion: Extending multimodal perception and mobile automation to iOS devices and simulators.
On-Device Lightweight VLMs: Local execution with lightweight edge vision models for low-latency, privacy-first automation.
Real-time Duplex Voice Interaction: Voice-driven task dispatch with real-time conversational control and interruption handling.
Community & Contributing
Contributions are warmly welcomed!
Star the repo to follow updates and releases
Join the Discord Community for technical discussions
Open an Issue or submit a Pull Request
License
This project is licensed under the Apache License 2.0.
Third-party code
Code not owned by Google lives under third_party/, one directory per upstream project, each with its own LICENSE and METADATA.
third_party/mobile_use– portions of mobile-use by Minitap, Inc., Apache License 2.0.
This server cannot be deployed
Maintenance
Related MCP Connectors
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Control real Android and iOS devices with LLM agents — tap, swipe, type, automate flows.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.8440Apache 2.0
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables AI assistants to interact with Android devices through ADB, allowing for automated device management, app installation, file transfers, and screenshot capture.301 npm38ISC
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI agents to control and automate Android devices through natural language, supporting actions like app management, UI interactions, and device monitoring.58MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents full control of Android devices and emulators through plain ADB — no companion APK, no extra daemon, no telemetry.266 npm4MIT