Overview
Droidrun controls devices through a specialized Portal app that bridges your computer and the device.- Android Setup
- iOS Setup (experimental)
Prerequisites
1
Install ADB
macOS:
brew install android-platform-tools
Linux: sudo apt install adb
Windows: Download from Android Developer SiteVerify: adb version
2
Enable USB Debugging
- Go to Settings > About phone
- Tap Build number 7 times (enables Developer options)
- Go to Settings > Developer options
- Enable USB debugging
- Connect device and tap Always allow
adb devices
3
Install Portal App
- Download the latest Portal APK
- Install with all permissions granted
- Enable accessibility service automatically
4
Verify Setup
Portal App
The Droidrun Portal (com.droidrun.portal
) provides:- Accessibility Tree - Extracts UI elements and their properties
- Device State - Tracks current activity, keyboard visibility
- Action Execution - Tap, swipe, text input, and other actions
- Dual Communication - TCP (faster) or Content Provider (fallback)
The Portal only communicates locally via ADB. No data is sent to external servers.
Communication Modes
TCP Mode (Recommended) - per operation
TCP Mode (Recommended) - per operation
How it works:Troubleshooting:
- Portal runs HTTP server on device port 8080
- ADB forwards local port → device port 8080
- Droidrun sends HTTP requests to
localhost:PORT
Content Provider (Fallback) - per operation
Content Provider (Fallback) - per operation
How it works:Troubleshooting:
- Portal exposes content provider at
content://com.droidrun.portal/
- Commands sent via ADB shell:
content query --uri ...
- JSON responses parsed from shell output
Advanced Setup
Wireless Debugging (Android 11+)
Wireless Debugging (Android 11+)
Setup
1
Enable Wireless Debugging
- Settings > Developer options > Wireless debugging
- Note IP address and port (e.g.,
192.168.1.100:37757
)
2
Pair Device (First Time)
QR Code Method:Pairing Code Method:
- Tap Pair device with pairing code
- Note pairing code and IP:port
- Run:
adb pair IP:PORT
- Enter pairing code
3
Connect
Common Issues
- Connection refused → Check same WiFi network and firewall
- Frequent drops → Use 5GHz WiFi or stay near router
- Can’t find IP → Run
adb shell ip addr show wlan0 | grep "inet "
via USB
Wireless Debugging (Android 10 and Below)
Wireless Debugging (Android 10 and Below)
1
Enable TCP/IP Mode (USB Required)
2
Find Device IP
3
Connect Wirelessly
Troubleshooting
Device not found
Device not found
Symptoms:
adb devices
shows no devices or unauthorized
Solutions:- Unplug/replug USB cable, try different port
- Revoke USB debugging authorizations (Developer options)
- Reconnect and tap “Always allow”
- Restart ADB:
adb kill-server && adb start-server
- Windows: Install Google USB Driver
Portal not installed
Portal not installed
Symptoms:
droidrun ping
fails with “Portal is not installed”Solutions:- Reinstall:
droidrun setup
- Check:
adb shell pm list packages | grep droidrun
- Verify APK architecture matches device (arm64-v8a for most devices)
Accessibility service not enabled
Accessibility service not enabled
Symptoms:
droidrun ping
fails with “accessibility service not enabled”Solutions:- Auto-enable:
- Manual: Settings > Accessibility > Droidrun Portal > Toggle ON
- Verify:
Text input not working
Text input not working
Symptoms:
input_text()
fails or types gibberishSolutions:- Keyboard auto-enabled by
AdbTools.__init__()
: - Manual switch: Long press space bar → Select “Droidrun Keyboard”
- Focus element first:
tools.tap_by_index(5)
thentools.input_text("text")
Empty UI state
Empty UI state
Symptoms:
get_state()
returns empty or incomplete UI treeSolutions:- Verify accessibility:
droidrun ping
- Some apps block accessibility services (WebViews, games, custom UI)
- Wait for UI:
time.sleep(1)
after tap/swipe - Enable Portal overlay to see detected elements
Next Steps
- Learn about the Agent System
- Explore Configuration Options
- Try Custom Tools
- Implement Structured Output