Skip to main content

Overview

Mobilerun controls devices through a specialized Portal app that bridges your computer and the device.

Prerequisites

1

Install ADB

macOS: brew install android-platform-toolsLinux: sudo apt install adbWindows: Download from Android Developer SiteVerify: adb version
2

Enable USB Debugging

  1. Go to Settings > About phone
  2. Tap Build number 7 times (enables Developer options)
  3. Go to Settings > Developer options
  4. Enable USB debugging
  5. Connect device and tap Always allow
Verify: adb devices
3

Install Portal App

This will:
  • Download the compatible Portal APK for your SDK version
  • Install with all permissions granted
  • Enable accessibility service automatically
4

Verify Setup


Portal App

The Mobilerun Portal (com.mobilerun.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

How it works:
  • Portal exposes content provider at content://com.mobilerun.portal/
  • Commands sent via ADB shell: content query --uri ...
  • JSON responses parsed from shell output
Usage:
Troubleshooting:

Advanced Setup

Setup

1

Enable Wireless Debugging

  1. Settings > Developer options > Wireless debugging
  2. Note IP address and port (e.g., 192.168.1.100:37757)
2

Pair Device (First Time)

QR Code Method:
Pairing Code Method:
  1. Tap Pair device with pairing code
  2. Note pairing code and IP:port
  3. Run: adb pair IP:PORT
  4. 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
1

Enable TCP/IP Mode (USB Required)

2

Find Device IP

3

Connect Wirelessly

List Devices

Target Specific Device

Parallel Control


Troubleshooting

Symptoms: adb devices shows no devices or unauthorizedSolutions:
  1. Unplug/replug USB cable, try different port
  2. Revoke USB debugging authorizations (Developer options)
  3. Reconnect and tap “Always allow”
  4. Restart ADB: adb kill-server && adb start-server
  5. Windows: Install Google USB Driver
Symptoms: mobilerun ping fails with “Portal is not installed”Solutions:
  1. Reinstall: mobilerun setup
  2. Check: adb shell pm list packages | grep mobilerun
  3. Verify APK architecture matches device (arm64-v8a for most devices)
Symptoms: mobilerun ping fails with “accessibility service not enabled”Solutions:
  1. Auto-enable:
  2. Manual: Settings > Accessibility > Mobilerun Portal > Toggle ON
  3. Verify:
Symptoms: input_text() fails or types gibberishSolutions:
  1. Keyboard auto-enabled by AndroidDriver initialization:
  2. Manual switch: Long press space bar → Select “Mobilerun Keyboard”
  3. Focus the element first (tap it), then input text
Symptoms: get_state() returns empty or incomplete UI treeSolutions:
  1. Verify accessibility: mobilerun ping
  2. Some apps block accessibility services (WebViews, games, custom UI)
  3. Wait for UI: time.sleep(1) after tap/swipe
  4. Enable Portal overlay to see detected elements

Next Steps