TroubleshootingPublished: 2 min read

adb error: more than one device/emulator: How to Fix

Fix "adb: error: more than one device/emulator" by choosing a device with -s, -d, -e or ANDROID_SERIAL, and by removing stale Wi-Fi connections and emulators.

You run an adb command and get:

adb: error: more than one device/emulator

adb sees two or more devices and does not know which one you mean. The fix is to name the device, or to remove the ones you do not want.

See what is connected

adb devices -l

Example:

List of devices attached
R58M123ABC             device usb:1-1 product:a54xnseea model:SM_A546B
emulator-5554          device product:sdk_gphone64 model:sdk_gphone64_arm64
192.168.1.20:5555      device product:redwood model:2211133G

Here there is a USB phone, an emulator and a phone over Wi-Fi. Any of them can be the "extra" one.

Choose a device for one command

FlagMeaningExample
-s <serial>A specific device by its serial or addressadb -s R58M123ABC shell
-dThe only device connected by USBadb -d install app.apk
-eThe only emulatoradb -e logcat
-t <id>The device with this transport id (from adb devices -l)adb -t 3 shell

For a Wi-Fi device the serial is its address: adb -s 192.168.1.20:5555 shell.

Choose a device for the whole terminal

Set ANDROID_SERIAL and every adb command in that terminal goes to that device:

export ANDROID_SERIAL=R58M123ABC        # macOS / Linux
set ANDROID_SERIAL=R58M123ABC           # Windows Command Prompt
$env:ANDROID_SERIAL = "R58M123ABC"      # Windows PowerShell

Remove the extra devices

  • An old Wi-Fi connection: adb disconnect 192.168.1.20:5555, or adb disconnect to drop all of them.
  • An emulator you forgot: close it in Android Studio, or adb -s emulator-5554 emu kill.
  • An offline ghost entry: adb kill-server clears it.
  • The same phone twice (once by USB, once over Wi-Fi): disconnect one of them.

Scripts with many devices

To run the same command on every connected device, loop over the serials:

for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
  adb -s "$s" shell getprop ro.product.model
done

More on running many phones in how to build an Android device lab.

Several devices in ADBKit

ADBKit never has this problem, because each device gets its own tab. Connect up to six phones over USB or Wi-Fi, switch between them like browser tabs, and every action goes to the device you are looking at. Only the visible tab streams video, so the others stay light. Open ADBKit and use + Add device to connect the next one.