Quickstart
Get up and running with DroidRun quickly and effectively
This guide will help you get DroidRun installed and running quickly, controlling your Android device through natural language in minutes.
π Prerequisites
Before installing DroidRun, ensure you have:
- Python 3.10+ installed on your system
- ADB (Android Debug Bridge) installed and configured
- Download Android SDK Platform Tools
- Make sure
adb
is in your PATH
- Android device with:
- Developer options enabled
- USB debugging enabled
- Connected via USB or on the same network (for wireless debugging)
- DroidRun Portal app installed on your Android device
- Available from the DroidRun Portal repository
- Installation instructions are provided in the Install DroidRun Portal App section below
π Installation Methods
Method 1: Install from PyPI (Recommended)
The simplest way to install DroidRun is using pip:
Method 2: Install from Source
To install the latest development version:
Using a virtual environment helps isolate DroidRunβs dependencies from your global Python environment, preventing potential conflicts with other packages.
π API Key Setup
DroidRun supports multiple LLM providers. Set up at least one:
OpenAI
- Sign up at OpenAI
- Create an API key
- Set environment variable:
Anthropic
- Sign up at Anthropic
- Get API key
- Set environment variable:
Google Gemini (Default)
- Sign up for Google AI Studio
- Create API key
- Set environment variable:
Ollama (Local)
- Install Ollama
- Pull desired models:
- No API key needed
Deepseek
- Sign up at Deepseek
- Get API key
- Set environment variable:
For convenience, create a .env
file:
Then load it:
π± Device Configuration
Verify ADB Installation
Ensure ADB is properly installed:
Connect to Device
Connect your device via USB or Wi-Fi:
Make sure:
- USB debugging is enabled
- Device appears in
droidrun devices
π¦ Install DroidRun Portal App
The DroidRun Portal app provides accessibility services needed for device control:
- Download the APK from DroidRun Portal repository
- Install using DroidRun:
The setup command will:
- Install the APK
- Enable accessibility service
- Configure necessary permissions
π» Run Your First Command
Test with these commands:
βοΈ Command Options
DroidRun CLI supports various options:
π Create a Simple Script
For complex automation, create a Python script:
π Using LlamaIndex Integration
DroidRun v2 uses LlamaIndex for LLM integration, providing more flexibility:
π Vision Capabilities
When vision is enabled:
- The agent can take and analyze screenshots
- Ideal for UI-based tasks that require visual context
π΅οΈ Tracing and Debugging
DroidRun integrates with Arize Phoenix for execution tracing and debugging:
Important: Before using tracing, you must start the Phoenix server in a separate terminal:
Then enable tracing with the --tracing
flag or enable_tracing=True
parameter.
Tracing provides:
- Visual execution flow
- LLM prompts and responses
- Tool execution details
- Error detection
For detailed instructions, see the Execution Tracing documentation.
π Token Usage Tracking
DroidRun tracks token usage for all LLM calls:
- Total prompt tokens
- Total completion tokens
- Number of API calls
This helps you optimize your automation tasks and manage costs effectively.
π§ Common Installation Issues
ADB Not Found
Ensure ADB is in your PATH or add it:
Device Not Detected
- Check that USB debugging is enabled on your device
- Try a different USB cable or port
- For wireless debugging, ensure device and computer are on the same network
API Key Issues
- Verify youβve correctly set the environment variable
- Ensure your API key is valid and has not expired
- Check for whitespace or extra characters in your API key
β Verify Installation
Verify DroidRun is installed correctly:
π Next Steps
Now that youβve got DroidRun running, you can:
- Learn about the DroidAgent system
- Explore planning capabilities
- Discover Android interactions
- Learn about the Portal App