I have an emulator started in eclipse and also a real device connected via usb on my computer. So in my DDMS it shows 2 devices with 2 different names ( one real and one emulator )
How can I specify on which device my ADB Commands will be executed ? ( I am missing a parameter to specify the device name )
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.
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.
Android Shell Commands. ADB is Android Debug Bridge which is a command line utility included with Google's Android SDK. It provides a terminal interface to control your Android device connected to a computer using a USB. ADB can be used to run shell commands, transfer files, install/uninstall apps, reboot and more.
If there are only one device and one emulator, you can use -d
and -e
options to direct the commands to the real device and emulator.
Device:
adb -d shell
Emulator:
adb -e shell
Alternatively, you can use -s <serialNumber>
option to direct the commands to a specific emulator/device instance:
$ adb devices
List of devices attached
emulator-5554 device
123456789b52315f device
$ adb -s emulator-5554 shell
$ adb -s 123456789b52315f shell
For other options, read the docs. Hope this helps.
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