How droidrun/mobilerun works
Mobilerun is a framework for LLM-driven Android and iOS automation. A user starts a task through the CLI or Python API; an agent interprets it, observes device state, issues mobile actions, and returns a result. Reasoning mode adds manager-led planning, while direct tasks, vision, structured output, app cards, custom tools, macros, MCP, and tracing provide distinct capabilities. The README documents the product workflow; source excerpts and the index confirm selected implementation links, but many runtime integrations were not sampled.
Main entry points: main.py CLI · manager_agent.py Reasoning manager · llm_picker.py Model selection · fast_agent.py Direct agent
Components 23
Entry and setup
- CLI
mobilerun/cli/main.py - Configuration
mobilerun/config_manager/config_manager.py
Agent runtime
- Reasoning manager
mobilerun/agent/manager/manager_agent.py - Direct agent
mobilerun/agent/fast_agent/fast_agent.py - Action executor
mobilerun/agent/executor/executor_agent.py - Tool registry
mobilerun/agent/tool_registry.py - Structured workflows
mobilerun/agent/oneflows/structured_output_agent.py
Mobile interaction
- UI state provider
mobilerun/tools/ui/provider.py - Device drivers
mobilerun/tools/driver - iOS provider
mobilerun/tools/ui/ios_provider.py - Android Portal
mobilerun/agent/droid/droid_agent.py
Workflow extensions
- App cards
mobilerun/app_cards/app_card_provider.py - Macro replay
mobilerun/macro/replay.py - MCP integration
mobilerun/mcp/client.py
Models and observability
- Model selection
mobilerun/agent/utils/llm_picker.py - Provider registry
mobilerun/agent/providers/registry.py - OAuth providers
mobilerun/agent/utils/oauth/openai_oauth_llm.py - Auth profiles
mobilerun/config_manager/auth_profile_store.py - Trajectory writer
mobilerun/agent/trajectory/writer.py - Tracing telemetry
mobilerun/telemetry/tracker.py
Other components
- Task author
- Phone
- LLM services
Connections 25
- Task author → CLI: submits task
- CLI → Configuration: loads settings
mobilerun/cli/main.py - CLI → Reasoning manager: runs reasoning
- CLI → Direct agent: runs direct task
- Reasoning manager → Action executor: plans actions
- Reasoning manager → UI state provider: reads UI state
mobilerun/agent/manager/manager_agent.py - Reasoning manager → App cards: loads guidance
mobilerun/agent/manager/manager_agent.py - Direct agent → UI state provider: observes device
- Action executor → Tool registry: dispatches actions
- Tool registry → Device drivers: uses device tools
- UI state provider → Device drivers: fetches device data
mobilerun/tools/ui/provider.py - Device drivers → Phone: controls
- iOS provider → Phone: targets iOS
- Android Portal → Phone: controls Android
- CLI → iOS provider: selects iOS
- CLI → Structured workflows: runs structured flow
- CLI → Macro replay: replays macros
mobilerun/cli/main.py - Configuration → MCP integration: configures servers
mobilerun/config_manager/config_manager.py - Reasoning manager → Model selection: requests inference
mobilerun/agent/manager/manager_agent.py - Direct agent → Model selection: requests inference
- Model selection → Provider registry: resolves model
mobilerun/agent/utils/llm_picker.py - Model selection → LLM services: sends prompts
- OAuth providers → Auth profiles: stores credentials
mobilerun/agent/utils/oauth/openai_oauth_llm.py - Reasoning manager → Trajectory writer: records execution
- CLI → Tracing telemetry: enables tracing