Sunday, June 5, 2022

[SOLVED] How to use ADB Shell when Multiple Devices are connected? Fails with "error: more than one device and emulator"

Issue

$ adb --help

-s SERIAL  use device with given serial (overrides $ANDROID_SERIAL)

$ adb devices
List of devices attached 
emulator-5554   device
7f1c864e    device

$ adb shell -s 7f1c864e
error: more than one device and emulator

Solution

Use the -s option BEFORE the command to specify the device, for example:

adb -s 7f1c864e shell

See also http://developer.android.com/tools/help/adb.html#directingcommands



Answered By - janot
Answer Checked By - Marilyn (WPSolving Volunteer)