> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobilerun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get up and running with Mobilerun quickly and effectively

[YouTube video player](https://www.youtube.com/embed/4WT7FXJah2I)

This guide will help you get Mobilerun installed and running quickly, controlling your Android device through natural language in minutes.

> [!NOTE]
>
> This is the **open source Framework**. It runs locally on your machine against your own Android device over adb, and it uses your own LLM provider key such as `GOOGLE_API_KEY` or `OPENAI_API_KEY`. If you would rather use hosted devices and a managed agent with no local setup, use the [Cloud Quickstart](https://docs.mobilerun.ai/cloud/quickstart.md) instead.

### Prerequisites

> [!WARNING]
>
> **Python 3.14 is not yet supported.** Installing Mobilerun on Python 3.14 will silently fall back to an older version (e.g. 0.3.9) due to a dependency that does not yet support Python 3.14. Use Python 3.11, 3.12, or 3.13.

Before installing Mobilerun, ensure you have:

1. **Python 3.11, 3.12, or 3.13** installed on your system
2. [Android Debug Bridge (adb)](https://developer.android.com/studio/releases/platform-tools) installed and configured
3. **Android device** with:
   * [Developer options enabled](https://developer.android.com/studio/debug/dev-options)
   * USB debugging enabled
   * Connected via USB or on the same network (for wireless debugging)

### Installation

Mobilerun is installed using [`uv`](https://docs.astral.sh/uv/), a fast Python package installer and resolver.

**Install uv (if not already installed):**

```bash theme={null}
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```

**Choose your installation method:**

**For CLI usage only:**

```bash theme={null}
uv tool install mobilerun
```

**For CLI + Python code integration:**

```bash theme={null}
uv pip install mobilerun
```

> [!NOTE]
>
> Google Gemini, OpenAI, xAI, DeepSeek, MiniMax, ZAI, Ollama, and OpenRouter support is included by default. Anthropic requires the optional extra: use `uv tool install 'mobilerun[anthropic]'` for CLI-only use or `uv pip install 'mobilerun[anthropic]'` in a Python project.

### Set Up the Portal APK (Recommended)

Portal is the recommended way to control Android devices. It improves text entry and helps Mobilerun read the screen reliably. To use Android through ADB without Portal, see [Device Setup](https://docs.mobilerun.ai/framework/guides/device-setup.md).

```bash theme={null}
mobilerun setup
```

This command automatically:

1. Downloads the Portal APK compatible with this Mobilerun version
2. Installs it on your connected device and grants the Android permissions allowed during installation
3. Attempts to enable the accessibility service, opening Settings if manual action is required

Use `mobilerun setup --latest` to opt into the newest Portal release, or `mobilerun setup --portal-version <version>` to pin a specific release.

### Test Connection

Verify that Portal is available:

```bash theme={null}
mobilerun ping
```

If successful, you'll see:

```
Portal is installed and accessible. You're good to go!
```

> [!NOTE]
>
> `mobilerun ping` checks Portal. For an ADB-only setup, run `adb devices -l` instead.

### Configure Your LLM

Run the configure wizard to choose your provider, auth method (API key or OAuth), and model:

```bash theme={null}
mobilerun configure
```

The wizard saves your provider and model settings. See the [CLI guide](https://docs.mobilerun.ai/framework/guides/cli.md) for OAuth sign-in commands and configuration file locations.

Alternatively, you can set an API key as an environment variable:

```bash theme={null}
# For Google Gemini (default)
export GOOGLE_API_KEY=your-api-key-here

# For OpenAI
export OPENAI_API_KEY=your-api-key-here

# For xAI Grok
export XAI_API_KEY=your-api-key-here

# For Anthropic Claude
export ANTHROPIC_API_KEY=your-api-key-here
```

### Run Your First Command via CLI

Now you're ready to control your device with natural language:

```bash theme={null}
# Using default configuration (Google Gemini)
mobilerun run "Open the settings app and tell me the Android version"

# Override provider and model
mobilerun run "Check the battery level" --provider OpenAI --model gpt-6-astra

# Enable vision mode (sends screenshots to LLM)
mobilerun run "What app is currently open?" --vision

# Enable reasoning mode (uses Manager-Executor workflow for complex tasks)
mobilerun run "Find a contact named John and send him an email" --reasoning
```

**Common CLI flags:**

* `--provider` - LLM provider (GoogleGenAI, OpenAI, XAI, Anthropic, etc.)
* `--model` - Model name (gemini-3.8-flash, gpt-6-astra, etc.); pass it together with `--provider`
* `--vision` - Enable screenshot processing
* `--vision-only` - Use screenshots without an accessibility tree
* `--reasoning` - Enable multi-agent planning mode
* `--steps N` - Maximum execution steps (default: 15)
* `--debug` - Enable detailed logging

### Create a Simple Agent via Script

For complex automation or integration into your Python projects, create a script:

```python theme={null}
import asyncio
from mobilerun import MobileAgent, MobileConfig

async def main():
    # Use default configuration with built-in LLM profiles
    config = MobileConfig()

    # Create agent
    # LLMs are automatically loaded from config.llm_profiles
    agent = MobileAgent(
        goal="Open Settings and check battery level",
        config=config,
    )

    # Run agent
    result = await agent.run()

    # Check results (result is a ResultEvent object)
    print(f"Success: {result.success}")
    print(f"Reason: {result.reason}")
    print(f"Steps: {result.steps}")

if __name__ == "__main__":
    asyncio.run(main())
```

## Next Steps

Now that you've got Mobilerun running, explore these topics:

* Walk through a [Guide](https://docs.mobilerun.ai/framework/guides/overview.md)
* Learn about [Agent Architecture](https://docs.mobilerun.ai/framework/concepts/architecture.md)
* Customize the Agent [Configuration System](https://docs.mobilerun.ai/framework/sdk/configuration.md)
* Guide the agent with [App Cards](https://docs.mobilerun.ai/framework/features/app-cards.md)

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.