Can I install an APK file if more than one emulator / device is connected?

I know how to install apk file in command line emulator and all that. But I want to know if it is possible to install the same apk file in several emulators by specifying any specific name? In fact, I have to check one apk file on many devices. and for this I started a lot of devices. I know how to install it. if the whole device is open, it will not be installed. So, is there an alternative to installing this apk file by providing any specific device emulator identifier or any name ??? Please help me if there is an idea. Thanks.

+77
android android-emulator emulation adb
Aug 25 2018-11-11T00:
source share
6 answers

Yes, you can install the APK on a specific device.

At the command, enter:

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

Then enter:

 adb -s "<deviceIDfromlist>" install "<path-to-apk>" 
+219
Aug 25 2018-11-11T00:
source share

Step 1: Get device identifiers on the device connected to the device

adb

Step 2: install on the specific device you want to install ypu

adb -s deviceId installation path + apk

Example:

step 1:

C: \ Android \ android-sdks \ platform-tools> adb devices List of connected devices emulator-5554 014FD87107021017

Step 2:

C: \ Android \ android-sdks \ platform-tools> adb -s 014FD87107021017 install C: \ Users \ User \ Documents \ appname.apk

+9
Dec 26
source share

On all connected devices, you can run the installation command at the same time .

The key is to run adb in a separate process (&).

I came up with the following script for simultaneous burning on all connected devices and finally launched the installed application on each of them:

 #!/bin/sh function install_job { adb -s ${x[0]} install -r PATH_TO_YOUR_APK adb -s ${x[0]} shell am start -n "com.example.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER } #iterate over devices IP-addresses or serial numbers and start a job while read LINE do eval x=($LINE) install_job ${x[0]} > /dev/null 2>&1 & done <<< "`adb devices | cut -sf 1`" echo "WATING FOR INSTALLATION PROCESSES TO COMPLETE" wait echo "DONE INSTALLING" 

Note 1: STDOUT and STDERR are suppressed. You will not see the result of the "adb install" operation. Perhaps this will improve if you really need to

Note 2:, you can also improve the script by specifying args instead of hard-coded path and activity names.

So you:

  • No need to manually install on each device
  • No need to wait for one installation to complete to complete another (adb tasks run in parallel)
+6
Feb 04 '15 at 12:51
source share

Use the following scripts to install apk on multiple devices / emulators.

  for SERIAL in $(adb devices | grep -v List | cut -f 1); do adb -s $SERIAL install -r /path/to/product.apk; done 

Remove -r if you do not reinstall apk. You can also replace "install -r / path / to / product.apk" with other adb commands, for example, working on the same device.

It works for me on real devices, but I believe that it should also work for emulators.

+5
Sep 24 '13 at 18:41
source share

yes, you can install your apk file in several emulators so that you give a name on the command line, here is a link for a guide

http://developer.android.com/guide/developing/tools/emulator.html

+2
Aug 25 2018-11-11T00:
source share

You can install on multiple devices simultaneously using USB debugging.

In Eclipse Run -> Run Configurations -> select a project (left) -> Target -> Run on all compatible devices.

The selected project will be installed on all connected devices.

0
Aug 27 '15 at 8:53
source share



All Articles