Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to install APK file if more than one emulators/devices are connected [duplicate]

I know how to install the apk file in to the emulator by command prompt and all that. But i want to know is it possible to install same apk file in to multiple emulator by giving any specific name ? Actually i have to test one apk file in to many device. and for that i have started many device. I know how to install it. if the all device are open then it will not get install. So is there any alternate to install that apk file by giving any specific device Emulator id or any name ??? Please help me if there is any idea for it. . . Thanks.

like image 715
Shreyash Mahajan Avatar asked Aug 25 '11 06:08

Shreyash Mahajan


People also ask

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

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.

How do I run an APK file on an emulator?

To install an APK file on the emulated device, drag an APK file onto the emulator screen. An APK Installer dialog appears. When the installation completes, you can view the app in your apps list. To add a file to the emulated device, drag the file onto the emulator screen.

How do I select a device in adb?

Use the -s option followed by a device name to select on which device the adb command should run. The -s options should be first in line, before the command.

How do I remove adb device?

To disable adb - you can use adb disconnect or simply turn off usb debugging under developer options . For disconnecting usb connection for internal storage certain ROMS have the option.


2 Answers

Yes, you can install an apk on a particular device.

In command, type:

adb devices // list of devices and its unique ID... 

Then type:

adb -s "<deviceIDfromlist>" install "<path-to-apk>" 
like image 200
Mohammed Azharuddin Shaikh Avatar answered Oct 24 '22 03:10

Mohammed Azharuddin Shaikh


Step 1: Get the device Ids of all connected device

adb devices 

Step 2: Install to a particular device you want to install

adb -s deviceId install path+apk 

Example:

Step 1:

C:\Android\android-sdks\platform-tools>adb devices 

List of devices attached emulator-5554 device 014FD87107021017
device

Step 2:

C:\Android\android-sdks\platform-tools>adb -s 014FD87107021017 install C:\Users\ user\Documents\appname.apk 
like image 38
Vinayak Avatar answered Oct 24 '22 03:10

Vinayak