Skip to main content
This guide covers setting up Android tools, configuring ADB, and troubleshooting common connection issues.

What You Need

  • Android SDK Platform Tools (includes ADB)
  • Android Device or Emulator
  • USB Cable (for physical devices)

Installation by Platform

macOS

Windows

  1. Install Android Studio
  2. During installation, ensure Android SDK is installed
  3. Open Settings > System > Environment Variables
  4. Add the SDK platform-tools folder to PATH
    • Typically: C:\Users\YourUsername\AppData\Local\Android\Sdk\platform-tools
  5. Open Command Prompt and verify:
    adb --version
    

Linux

Using apt (Debian/Ubuntu):
sudo apt-get install android-tools-adb
Verify:
adb --version

Connect Your Device

Physical Android Device

  1. Enable USB Debugging:
    • Go to Settings > Developer Options
    • If “Developer Options” isn’t visible: Go to Settings > About Phone > tap “Build Number” 7 times
    • Enable “USB Debugging”
  2. Connect via USB:
    • Plug your device into your computer with a USB cable
    • On your device, you’ll see a prompt asking to allow USB debugging
    • Tap “Allow” or “Always allow from this computer”
  3. Verify Connection:
    adb devices
    
    You should see your device listed:
    List of attached devices
    ABC123456                      device
    

Android Emulator

The emulator is simpler—it auto-detects. Just make sure it’s running:
adb devices
You should see:
List of attached devices
emulator-5554                      device

OpenTester Configuration

Auto-Detection

OpenTester automatically looks for ADB in:
  1. System PATH
  2. ANDROID_HOME environment variable
  3. Common Android SDK locations
For most setups, no configuration is needed.

Manual ADB Path

If OpenTester can’t find ADB, manually set the path when installing:
claude mcp add openTester -- npx -y opentester-mcp-server --adb-path /path/to/adb

Troubleshooting

”adb: command not found”

Problem: ADB is not in your PATH. Solution:
  1. Find where ADB is installed:
    find ~ -name adb -type f
    
  2. Add its directory to PATH by editing ~/.zshrc or ~/.bash_profile:
    export PATH="$PATH:/path/to/adb/directory"
    
  3. Reload your shell:
    source ~/.zshrc
    

“No devices detected”

Problem: ADB is installed but shows no devices. Solution:
  1. Verify connection:
    adb devices
    
  2. For physical devices:
    • Check that USB debugging is enabled in Settings > Developer Options
    • Unplug and replug the USB cable
    • You should see an “Allow USB debugging?” prompt on your device—tap “Allow”
  3. Restart ADB:
    adb kill-server
    adb devices
    
  4. Check device permissions (macOS/Linux):
    adb devices -l
    
    If you see unauthorized, unplug and replug, then approve the prompt on your device.

”Device offline”

Problem: Device appears as “offline” in adb devices. Solution:
  1. Unplug the USB cable
  2. Wait 5 seconds
  3. Plug back in
  4. On your device, approve the USB debugging prompt
  5. Try again: adb devices

”Multiple devices detected”

Problem: You have multiple devices and OpenTester doesn’t know which one to use. Solution: OpenTester defaults to the first device. If you need a specific device:
adb -s <device-id> shell
You can also set the ANDROID_DEVICE_ID environment variable if you need to specify which device to use.

Emulator Issues

Emulator won’t start:
  • Make sure you have enough disk space
  • Try restarting Android Studio
  • Check that hardware acceleration is enabled in your emulator settings
Emulator disconnects:
  • Restart the emulator
  • Restart ADB: adb kill-server; adb devices

Verify Complete Setup

Test that everything is working:
# Check ADB is installed
adb --version

# List connected devices
adb devices

# Shell into device/emulator
adb shell getprop ro.build.version.release
The last command should return your Android version, confirming the connection works.

Setting ANDROID_HOME (Optional)

Many tools expect ANDROID_HOME to be set. Add to your shell profile: macOS/Linux (~/.zshrc or ~/.bash_profile):
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH="$PATH:$ANDROID_HOME/platform-tools"
Windows (System Variables):
ANDROID_HOME=C:\Users\YourUsername\AppData\Local\Android\Sdk
Then restart your terminal or command prompt.

Need More Help?