Quick Start
MobileAgent Parameters
Required
Optional Parameters
Configuration Classes
AgentConfig
system_prompt unset to use the built-in prompt for the selected Manager mode. To use a custom prompt, provide a file path or pass manager_system to MobileAgent. See Prompt Templates.
ExecutorConfig
DeviceConfig
portal_mode controls Android Portal use:
auto(default) uses Portal when available and uses ADB/UIAutomator if Portal cannot perform an action.requiredrequires Portal and its keyboard. If Portal text input, app listing, screenshots, or UI reading fails, the operation fails instead of switching to ADB.disableduses ADB/UIAutomator only.
auto_setup=True installs or repairs Portal before an Android run. It is skipped when portal_mode="disabled".
LoggingConfig
TracingConfig
TelemetryConfig
ToolsConfig
click_at, click_area, and long_press_at. With vision enabled, click_at becomes available unless normalized coordinates are used. Pass a list to choose which tools to disable, or [] to disable none.
Screenshot-only modes require all three coordinate tools and reject configurations that disable them. See Vision Mode for details.
CredentialsConfig
LLM Configuration
Single LLM (All Agents)
mobilerun.load_llm(), as shown above.
For xAI Grok, set XAI_API_KEY and use:
Per-Agent LLMs
manager- Planning (reasoning mode only)executor- Action selection (reasoning mode only)fast_agent- Direct executionapp_opener- App launching helperstructured_output- Final output extraction
Custom Tools
Credentials
Dict Format (Recommended)
Config Format
Custom Variables
Structured Output
Custom Prompts
Complete Example
YAML Config (CLI)
For CLI usage, createconfig.yaml:
Ollama profiles
Ollama profiles accept the same portablekwargs as other providers — max_tokens and context_window work consistently across providers, and Mobilerun translates them to Ollama’s native parameters at runtime.
CLI Overrides
--config PATH- Custom config file--device SERIAL- Device serial/IP--agent NAME- Run an installed external Android agent--provider PROVIDER- LLM provider override--model MODEL- LLM model override; pass it together with--provider--temperature FLOAT- LLM temperature--steps INT- Max steps--base_url URL- API base URL (for Ollama/OpenRouter/MiniMax)--api_base URL- API base URL (for OpenAI-like)--vision/--no-vision- Enable/disable vision for all agents--vision-only/--no-vision-only- Use screenshots without an accessibility tree--reasoning/--no-reasoning- Enable/disable reasoning mode--stream/--no-stream- Enable/disable streamed console output--tracing/--no-tracing- Enable/disable tracing--debug/--no-debug- Enable/disable debug logs--tcp/--no-tcp- Enable/disable TCP communication--control-backend visual-remote- Connect to a Visual Remote server--device-id ID- Select one device when a server offers more than one--save-trajectory none|step|action- Trajectory saving level--ios- Run on iOS device
Environment Variables
Set API keys via environment variables:MiniMax
MiniMax defaults toMiniMax-M3. Use https://api.minimax.io/v1 for global accounts or https://api.minimaxi.com/v1 for Mainland China accounts:
MiniMax-M3 is unavailable in Mainland China, use MiniMax-M2.7. To use MINIMAX_API_KEY instead of a saved key, select the environment-key option in the wizard.