Skip to main content

Quick Start


MobileAgent Parameters

Required

Optional Parameters


Configuration Classes

AgentConfig

FastAgentConfig
ManagerConfig
Leave 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
AppCardConfig

DeviceConfig

portal_mode controls Android Portal use:
  • auto (default) uses Portal when available and uses ADB/UIAutomator if Portal cannot perform an action.
  • required requires Portal and its keyboard. If Portal text input, app listing, screenshots, or UI reading fails, the operation fails instead of switching to ADB.
  • disabled uses 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

Example - Disable specific tools:
By default, Mobilerun disables 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)

Create Google models with mobilerun.load_llm(), as shown above. For xAI Grok, set XAI_API_KEY and use:

Per-Agent LLMs

LLM Keys:
  • manager - Planning (reasoning mode only)
  • executor - Action selection (reasoning mode only)
  • fast_agent - Direct execution
  • app_opener - App launching helper
  • structured_output - Final output extraction

Custom Tools


Credentials

Config Format


Custom Variables


Structured Output


Custom Prompts

Each prompt key receives a different context. See Prompt Templates for the exact variables available to Manager, Executor, and FastAgent templates.

Complete Example


YAML Config (CLI)

For CLI usage, create config.yaml:

Ollama profiles

Ollama profiles accept the same portable kwargs as other providers — max_tokens and context_window work consistently across providers, and Mobilerun translates them to Ollama’s native parameters at runtime.
The 32K default keeps Ollama on the GPU for most models. If you need the model’s full context, set context_window: -1 explicitly.

CLI Overrides

Run flags:
  • --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
See the CLI guide for provider examples and option defaults.

Environment Variables

Set API keys via environment variables:

MiniMax

MiniMax defaults to MiniMax-M3. Use https://api.minimax.io/v1 for global accounts or https://api.minimaxi.com/v1 for Mainland China accounts:
If 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.