Install
openclaw skills install android-agentControl a real Android phone via USB or network using GPT-4o vision to run tasks like opening apps, typing, tapping, and automation scripts.
openclaw skills install android-agentPlug your old Android phone into your Mac/PC. Now your AI assistant can use it.
Got an old Android in a drawer? Connect it to any machine running OpenClaw — your gateway, a Mac Mini, a Raspberry Pi. Your AI can now open apps, tap buttons, type text, and complete tasks on a real phone. Book a cab, order food, check your bank app — anything you'd do with your thumbs.
Your AI agent sees the phone screen (via screenshots), decides what to tap/type/swipe, and executes actions via ADB. Under the hood it uses DroidRun with GPT-4o vision.
┌─────────────┐ screenshots ┌──────────────┐ ADB commands ┌─────────────┐
│ GPT-4o │◄─────────────────│ DroidRun │──────────────────►│ Android │
│ Vision │─────────────────►│ Agent │◄──────────────────│ Phone │
│ │ tap/type/swipe │ │ screen state │ │
└─────────────┘ └──────────────┘ └─────────────┘
Phone plugged into your OpenClaw gateway machine via USB. Zero networking required.
[Gateway Machine] ──USB──► [Android Phone]
Phone plugged into a Mac Mini, Raspberry Pi, or any OpenClaw node. The gateway controls it over the network.
[Gateway] ──network──► [Mac Mini / Pi node] ──USB──► [Android Phone]
For Node mode, connect ADB over TCP/WiFi so the node can forward commands.
On your Android phone:
# Plug phone in via USB, then:
pip install -r requirements.txt
adb devices # verify phone shows up — authorize on phone if prompted
export OPENAI_API_KEY="sk-..."
python scripts/run-task.py "Open Settings and turn on Dark Mode"
That's it. The script handles everything: waking the screen, unlocking, keeping the display on, and running your task.
python scripts/run-task.py "Order an Uber to the airport"
python scripts/run-task.py "Set an alarm for 6 AM tomorrow"
python scripts/run-task.py "Check my bank balance on PhonePe"
python scripts/run-task.py "Open Google Maps and navigate to the nearest coffee shop"
python scripts/run-task.py "Send a WhatsApp message to Mom saying I'll be late"
python scripts/run-task.py "Read my latest SMS messages"
python scripts/run-task.py "Open Telegram and check unread messages"
python scripts/run-task.py "Open Amazon and search for wireless earbuds under 2000 rupees"
python scripts/run-task.py "Add milk and bread to my Instamart cart"
python scripts/run-task.py "Open Google Calendar and check my schedule for tomorrow"
python scripts/run-task.py "Create a new note in Google Keep: Buy groceries"
python scripts/run-task.py "Play my Discover Weekly playlist on Spotify"
python scripts/run-task.py "Open YouTube and search for lo-fi study music"
python scripts/run-task.py "Turn on Dark Mode"
python scripts/run-task.py "Connect to my home WiFi network"
python scripts/run-task.py "Enable Do Not Disturb mode"
python scripts/run-task.py "Turn off Bluetooth"
python scripts/run-task.py "Take a screenshot"
python scripts/run-task.py "Open the camera and take a photo"
python scripts/run-task.py "Clear all notifications"
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | Yes | API key for GPT-4o vision |
ANDROID_SERIAL | No | Device serial number. Auto-detected if only one device is connected |
ANDROID_PIN | No | Phone PIN/password for auto-unlock. If not set, unlock is skipped |
DROIDRUN_TIMEOUT | No | Task timeout in seconds (default: 120) |
Install ADB:
# macOS
brew install android-platform-tools
# Ubuntu/Debian
sudo apt install android-tools-adb
# Windows
# Download from https://developer.android.com/tools/releases/platform-tools
Connect phone via USB and verify:
./scripts/connect.sh usb
Install DroidRun Portal APK on the phone:
adb install droidrun-portal.apkInstall Python dependencies:
pip install -r requirements.txt
On the node machine (Mac Mini, Pi, etc.), connect the phone via USB and enable WiFi ADB:
adb tcpip 5555
adb connect <phone-ip>:5555
From your gateway, connect to the node's ADB:
# If using SSH tunnel:
ssh -L 15555:<phone-ip>:5555 user@node-ip
export ANDROID_SERIAL="127.0.0.1:15555"
# Or direct WiFi (same network):
./scripts/connect.sh wifi <phone-ip>
Run tasks as normal — the script uses whatever ANDROID_SERIAL points to.
The DroidRun Portal APK must be installed and running on the phone. It provides the accessibility service that allows DroidRun to read screen content and interact with UI elements.
scripts/run-task.py — The Main Script# Basic usage
python scripts/run-task.py "Your task description here"
# With options
python scripts/run-task.py --timeout 180 "Install Spotify from Play Store"
python scripts/run-task.py --model gpt-4o "Open Chrome and search for weather"
python scripts/run-task.py --no-unlock "Take a screenshot"
python scripts/run-task.py --serial 127.0.0.1:15555 "Check notifications"
python scripts/run-task.py --verbose "Open Settings"
Options:
| Flag | Description |
|---|---|
goal | Task description (positional, required) |
--timeout | Timeout in seconds (default: 120, or DROIDRUN_TIMEOUT env) |
--model | LLM model to use (default: gpt-4o) |
--no-unlock | Skip the auto-unlock step |
--serial | Device serial (default: ANDROID_SERIAL env or auto-detect) |
--verbose | Show detailed debug output |
scripts/connect.sh — Setup & Verify Connection./scripts/connect.sh # Auto-detect USB device
./scripts/connect.sh usb # USB mode (explicit)
./scripts/connect.sh wifi 192.168.1.100 # WiFi/TCP mode
scripts/screenshot.sh — Screenshot (ADB screencap, reliable)DroidRun’s internal screenshot sometimes fails on certain devices. Use this to bypass DroidRun and capture a PNG directly via ADB.
# Save to /tmp/android-screenshot.png
./scripts/screenshot.sh
# Explicit serial + output path
./scripts/screenshot.sh 127.0.0.1:15555 /tmp/a03.png
You can also do it from Python:
python scripts/run-task.py --screenshot --serial 127.0.0.1:15555 --screenshot-path /tmp/a03.png
scripts/status.sh — Device Status./scripts/status.sh
# Output:
# 📱 Device: Samsung Galaxy A03 (SM-A035F)
# 🤖 Android: 11 (API 30)
# 🔋 Battery: 87%
# 📺 Screen: ON (unlocked)
# 🔌 Connection: USB
# 📦 DroidRun Portal: installed (v0.5.5)
adb kill-server && adb start-server--verbose to see what the agent is seeing./scripts/connect.sh usb first, then ./scripts/connect.sh wifi <ip>adb shell getevent -l and tap each digitadb shell input text <PIN> as a fallback on some devicesANDROID_PIN environment variable (never hardcode it)Use a dedicated test device, not your primary phone.
Bottom line: Treat the connected phone as a "work device for AI." Don't leave personal accounts logged in. Don't store secrets on it. If you wouldn't hand your unlocked phone to a stranger, don't point this skill at it.
MIT — see LICENSE