$ 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
If there\'s only one emulator running or only one device connected, the adb command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the -d, -e, or -s option to specify the target device to which the command should be directed.
But, in order to execute several commands in one line, you may use adb shell "cmd1;cmd2;cmd3" . The && command mentioned by @Rachit is not quite right, because in the case adb shell "netcfg && ps && getprop" , command ps will be executed only when netcfg is executed without error raised.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With