MCPcopy Index your code
hub / github.com/droidrun/mobilerun

github.com/droidrun/mobilerun @v0.6.8 sqlite

repository ↗ · DeepWiki ↗ · release v0.6.8 ↗
1,259 symbols 5,437 edges 156 files 497 documented · 39%
README

Mobilerun is an open-source framework for controlling Android and iOS devices with LLM agents.

It gives agents mobile-native tools to inspect UI state, understand screenshots, tap, swipe, type, plan multi-step workflows, and return results through a CLI or Python API.

📕 Documentation · ☁️ Mobilerun Cloud

GitHub stars mobilerun.ai Twitter Follow Discord Benchmark

Droidrun - Give AI native control of physical & virtual phones. | Product Hunt

Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文

Mobilerun automating a phone with natural language

  • 🤖 Control Android and iOS devices with natural language commands
  • 🔀 Use OpenAI, Anthropic, Gemini, Ollama, DeepSeek, OpenRouter, and OpenAI-compatible models
  • 🧠 Run direct tasks or enable reasoning mode for complex multi-step automation
  • 💻 Automate from the CLI, a terminal UI, Docker, or Python code
  • 🐍 Extend agents with custom tools, structured output, app cards, and credentials
  • 📸 Combine accessibility trees with screenshots for visual understanding
  • 🫆 Trace execution with Arize Phoenix or Langfuse

Use the framework when you want to run the agent on your machine. Use Mobilerun Cloud when you want a ready-to-go solution for your local phones or cloud-hosted virtual/physical phones, managed infrastructure, and API-driven device workflows without running the agent on your local machine. Check out our benchmark results.

📦 Installation

Note: Python 3.14 is not currently supported. Please use Python >=3.11,<3.14.

Install Mobilerun with uv:

# CLI usage
uv tool install mobilerun
# CLI + Python integration
uv pip install mobilerun

Most LLM providers are included by default. For Anthropic support, install the optional extra:

uv tool install "mobilerun[anthropic]"

🚀 Quickstart

uv tool install mobilerun
mobilerun setup
mobilerun configure
mobilerun run "Open settings and turn on dark mode"

Before starting, make sure you have ADB installed and an Android device with Developer options and USB debugging enabled. iOS setup is supported separately through the iOS Portal flow.

1. Install the Portal on your device

mobilerun setup

This installs the Mobilerun Portal app, enables its accessibility service, and prepares the device for local control.

2. Verify the connection

mobilerun ping

You should see confirmation that the Portal is installed and accessible.

3. Configure your LLM provider

mobilerun configure

The wizard walks you through choosing a provider, auth method, and model. You can also use provider environment variables such as GOOGLE_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY.

4. Run your first command

mobilerun run "Open the settings app and tell me the Android version"

Useful run options:

mobilerun run "Open settings and turn on dark mode"
mobilerun run "What app is currently open?" --vision
mobilerun run "Find a contact named John and send him an email" --reasoning
mobilerun run "Take a screenshot" --ios
mobilerun run "Open Settings" --steps 30 --debug

Read the full framework documentation.

Quickstart Video

⚙️ Features

  • CLI: Run one-off natural language tasks, inspect devices, replay macros, and debug from the terminal.
  • Python API: Build custom mobile automation workflows with Python and use custom tools.
  • Android and iOS support: Control Android through the Portal app or target iOS through the iOS Portal flow.
  • Portal-based control: Use UI trees, screenshots, text input, gestures, app launching, and device state from the Portal runtime.
  • Vision mode: Send screenshots to the LLM with --vision, or use screenshot-only control with --vision-only (useful for the apps that do not have a11y tree information).
  • Reasoning mode: Use --reasoning for manager-executor planning on longer or more complex tasks.
  • Tracing and telemetry: Debug execution with Arize Phoenix, Langfuse, saved trajectories, and detailed logs.
  • Structured output: Return structured data from mobile workflows.
  • App cards and custom tools: Add app-specific guidance to make agent perform better on your use-cases.
  • Docker: Run Mobilerun in a container for repeatable local environments.

☁️ Framework vs Cloud

Mobilerun Framework Mobilerun Cloud
Best for Running agents locally on your own machine and devices Ready-to-go local phone control, hosted real or virtual devices, API workflows, and managed device operations
Runtime Your machine Mobilerun-managed infrastructure
Interface CLI, Docker, and Python API Dashboard, REST API, SDKs, and hosted devices

Use the framework when you want full local control of the agent runtime. Use Mobilerun Cloud when you want managed devices, fleet workflows, or cloud APIs without running the agent locally. Learn more in the framework overview and the cloud docs.

Which should I choose?

  • Choose Mobilerun Framework for local agent execution and code-level control.
  • Choose Mobilerun Cloud for managed phones, APIs, and scale without running agents locally.

Cloud Device Types

Device type What it is Best for
Personal Your own hardware connected to Mobilerun Cloud Quick automation on devices you own
Cloud Phone (Hosted) Instantly available cloud-hosted phone Scalable hosted automation
Physical Phone (Hosted) Real hardware with stronger identity characteristics Workflows that need high device authenticity and trust

🎬 Demo Videos

Book accommodation from a prompt

Shows multi-step navigation, text input, and app-state reasoning while Mobilerun searches for accommodation.

Mobilerun booking accommodation from a prompt

Find trending content

Shows browsing, app navigation, and result extraction from a natural-language task.

Mobilerun finding trending content from a prompt

Maintain an app streak

Shows a short recurring mobile workflow that can be automated from a prompt.

Mobilerun maintaining an app streak from a prompt

💡 Example Use Cases

  • Mobile app QA and regression testing
  • Guided workflows for non-technical users
  • Repetitive task automation on mobile devices
  • Event-driven automation from schedules, notifications, or custom triggers
  • Data extraction from native mobile apps
  • Running automations on multiple devices at once

📚 Documentation

👥 Contributing

Contributions are welcome. Please feel free to submit a pull request or open an issue.

📄 License

This project is licensed under the MIT License. See LICENSE for details.

Security Checks

To help catch security issues before submitting changes, run:

bandit -r mobilerun
safety scan

Core symbols most depended-on inside this repo

list
called by 34
mobilerun/macro/cli.py
load_llm
called by 25
mobilerun/agent/utils/llm_picker.py
flatten_tree
called by 20
mobilerun/tools/helpers/element_search.py
should_resize_model_screenshot
called by 20
mobilerun/tools/ui/provider.py
_convert_action_point
called by 18
mobilerun/agent/utils/actions.py
write
called by 18
mobilerun/agent/trajectory/writer.py
_print_result
called by 16
mobilerun/cli/doctor.py
register
called by 16
mobilerun/agent/tool_registry.py

Shape

Method 583
Function 495
Class 180
Route 1

Languages

Python100%

Modules by API surface

tests/test_visual_remote_connection.py52 symbols
mobilerun/agent/utils/oauth/openai_oauth_llm.py46 symbols
mobilerun/agent/utils/oauth/gemini_oauth_code_assist_llm.py37 symbols
mobilerun/agent/utils/oauth/anthropic_oauth_llm.py35 symbols
mobilerun/agent/trajectory/writer.py31 symbols
mobilerun/cli/main.py30 symbols
tests/test_llm_picker.py29 symbols
mobilerun/tools/helpers/element_search.py29 symbols
mobilerun/telemetry/langfuse_processor.py27 symbols
mobilerun/agent/utils/actions.py27 symbols
mobilerun/tools/driver/visual_remote.py26 symbols
tests/test_ios_vision_coordinate_contract.py25 symbols

Dependencies from manifests, versioned

InquirerPy0.3.4 · 1×
aiofiles25.1.0 · 1×
arize-phoenix12.3.0 · 1×
async_adbutils
httpx0.27.0 · 1×
llama-index0.14.4 · 1×
llama-index-callbacks-arize-phoenix0.6.1 · 1×
llama-index-llms-google-genai0.8.5 · 1×
llama-index-llms-ollama0.7.2 · 1×
llama-index-llms-openai0.6.0 · 1×
llama-index-llms-openai-like0.6.0 · 1×
llama-index-llms-openrouter0.4.2 · 1×

For agents

$ claude mcp add mobilerun \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact