$ 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
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