Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adb shell and adb push for specific avd

Tags:

android

adb

avd

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 )

like image 466
mcfly soft Avatar asked Nov 20 '13 10:11

mcfly soft


People also ask

What is adb push?

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.

Which adb option should be used if multiple devices are connected?

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.

What are adb shell commands?

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.


1 Answers

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.

like image 57
ozbek Avatar answered Sep 28 '22 10:09

ozbek