连接多个设备时如何使用ADB Shell?因“错误:多个设备和模拟器"而失败

连接多个设备时如何使用ADB Shell?因“错误:多个设备和模拟器

问题描述:

$ 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

在命令之前使用 -s 选项来指定设备,例如:

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

adb -s 7f1c864e shell

另见http://developer.android.com/tools/help/adb.html#directingcommands