By aryaxt


2010-08-13 19:43:31 8 Comments

I finally managed to obfuscate my Android application, now I want to test it by installing the APK file and running it on the emulator.

How can I install an APK file on the Android Emulator?

30 comments

@BloodLoss 2019-10-06 08:23:15

Just drag and drop your apk to emulator

@SiL3NC3 2019-09-29 11:30:55

Late, but to be completed with options here: A handy tool to install any apk via gui to a running emulator is: http://apkinstaller.com

This can directly connect to a running instance via adb and can successfully install any kind of apk packages.

Maybe this is also helpful for other people. ;)

@Mayuri Khinvasara 2019-09-09 08:24:08

(1) You can also use gradle commands to install your APK while choosing the product and flavor (Debug or Release). See this Guide.

./gradlew assembleDebug (Incase you don't have the APK generated)


./gradlew installDebug

Incase you want a fresh install, you can remove any earlier installed builds on the device with below commands

./gradlew uninstallDebug
./gradlew installDebug

(2) You can also use the adb commands directly:

Setup adb for command line

export PATH=/Users/mayurik/Library/Android/sdk/platform-tools/adb:/Users/mayurik/Library/Android/sdk/tool

Command line ADB install

adb -d install pathto/sample.apk (on device)
adb -e install pathto/sample.apk (on emulator)

Also check the documentation here

$ adb devices
List of devices attached
emulator-5554 device
emulator-5555 device

$ adb -s emulator-5555 install helloWorld.apk

@Dan Alboteanu 2018-02-11 06:00:37

Drag and drop ".apk" file into the emulator window.

@Pang 2018-11-13 05:01:03

This appears to be just a repeat of this existing answer.

@zeeawan 2016-05-08 10:53:50

Drag and drop

Simply drag-and-drop the apk file into your emulator.

You can also run your android emulator without Android Studio.

@user6754053 2016-09-08 20:12:34

Follow the steps :

  1. make sure you have allowed installation from unknown sources in settings.
  2. Use the Android Device Monitor to copy the APK to the sdcard.
  3. Use the builtin browser in Android to navigate to file:///sdcard/apk-name.apk
  4. When the notification "Download complete" appears, click it.

@SachiN Ware. 2014-03-14 09:47:19

keep your emulator up and running. In the command line, go inside the platform-tools folder, in your sdk folder which come with adt bundle and execute following command :

>adb install <yourFilename.apk>

This command detect your running emulator/emulators and show you the list of devices where you can install this app(show if any physical device/devices connected to your computer.). Then you can select any one, if only one emulator is running then app will directly installed on it by default.

Note: For above command your .apk file needs to be in same directory.

for more detailed tutorial follo : This link

@Skitty 2018-04-23 06:42:49

First you need to install Android Studio on your machine. Then simply follow these steps.

  1. Go to you navigation bar and open Android Studio. enter image description here
  2. From the toolbar open AVD Manager. (If you cannot see it create a new android project) enter image description here
  3. Create a Virtual Device. enter image description here
  4. Select a hardware device that you want to install your app. enter image description here
  5. Select an android image that you want to install on your device. (If you cannot see any images you can download the require image from Recommended, x86 Images or Other images) enter image description here
  6. Add a name to your AVD. enter image description here
  7. Now the virtual device has been created and you can simply run it by clicking the play button. enter image description here
  8. Now you have setup the virtual device and now you need to install the APK file. enter image description here
  9. Download the APK file that you want to install and Drag and Drop it to the emulator. enter image description here
  10. The APK file has been successfully installed and you can see it in your applications. enter image description here
  11. Now you can simply run the installed app. enter image description here

@Jorgesys 2010-08-13 19:50:07

You can simply drag and drop the .apk file of your application to the emulator and it will automatically starts installing.

Another options:


Windows:

  1. Execute the emulator (SDK Manager.exe->Tools->Manage AVDs...->New then Start)
  2. Start the console (Windows XP), Run -> type cmd, and move to the platform-tools folder of SDK directory.
  3. Paste the APK file in the 'android-sdk\tools' or 'platform-tools' folder.
  4. Then type the following command.

    adb install [.apk path]

    Example:

    adb install C:\Users\Name\MyProject\build\Jorgesys.apk

Linux:

  1. Copy the apk file to platform-tools in android-sdk linux folder.
  2. Open Terminal and navigate to platform-tools folder in android-sdk.
  3. Then Execute this command -

    ./adb install FileName.apk

  4. If the operation is successful (the result is displayed on the screen), then you will find your file in the launcher of your emulator.

Mac:

PATH=$PATH:~/Library/Android/sdk/platform-tools

Example : PATH=$PATH:/users/jorgesys/eclipse/android-sdk-mac_64/tools

Then run adb.

Mac:

1.Run the emulator,

2.then copy your .apk file and paste into /Users/your_system_username/Library/Android/sdk/platform-tools,
if you are not able to find sdk path in your mac system, do the following steps: Open finder->select Go option on top menu -> select Go to Folder option -> it will popup a window with a textfield: /Users/your_system_username/Library/Android/sdk/ -> now open platform-tools folder and paste your copied .apk file,

  1. Now open terminal and type the following: cd Library/Android/sdk/platform-tools

  2. execute the following in your terminal: ./adb install yourapkfilename.apk if you get the following error message: error: no devices found - waiting for device, follow the step 5.

  3. Run your emulator from Android Studio, once emulator active then repeat step 4, you will see the success message on your terminal.

@Dimuthu 2012-03-10 15:26:41

The adb has moved to 'platform-tools' in Windows too

@Camille Sévigny 2012-04-10 15:17:59

Just wanted to add a little something that is missing from the above answer. You must put the apk file in the "android-sdk\tools" directory. With this information, the answer works perfectly.

@Sahil Mahajan Mj 2012-10-08 11:55:29

The answer works perfectly with @CamilleSévigny comment. You should first put the apk file in the tools directory, then set the path in cmd with the same as that of tools direcory and at last execute the apk.

@mklement0 2013-09-04 15:38:46

Seems that the location of the APK can be freely chosen, as long as it is referenced correctly in the adb install command (verified on a Mac). As for the location of adb: on a Mac, as of at least ADT bundle version 20130522, the platform tools can be found in $HOME/Development/adt-bundle-mac-x86_64-<date>/sdk/platform-‌​tools.

@Jorgesys 2013-10-21 15:20:01

@Mr_and_Mrs_D, install the drivers for your device. dominantwire.com/2012/11/…

@Mr_and_Mrs_D 2013-10-21 17:40:28

Wasn't that - adb kill-server then adb start-server - I had started the emulator from eclipse

@Grzegorz Oledzki 2014-01-04 13:28:35

The Linux link is broken.

@Ela782 2014-03-11 19:59:53

You should not put the .apk in the platform-tools directory. Your project doesn't belong there. Use the full path on 'adb install' instead, e.g. 'adb install "C:\Users\Name\MyProject\build\myapp.apk".

@Jorgesys 2014-03-11 21:14:47

this is just an example but you´re right, will be more correct specifing the path to the .apk file. thank you!

@gnganpath 2014-11-12 11:57:03

Step to install APK in Emulator

@gnganpath 2014-11-12 12:02:31

Step to install APK in Emulator : Step 1 -> Run the emulator step 2-> Paste the apk in SDK manager tools and platform-tools folders. Step 3->Run this command adb install AppNaem.APK .Wait for 2 min it's show Success Message. Sometimes App icon closed unfortunatl. But App will run continuous Try / click.

@Naveen Agrawal 2015-12-30 12:21:08

Works only if AVD or emulator is running. Start AVD or emulator before executing ./adb install FileName.apk

@Hal50000 2016-05-01 14:28:58

This needs to be corrected so people understand the irrelevance of the apk location. They are probably accidentally getting adb in the path by going to the tools or platform-tools directory.

@IAmAndroid 2016-08-25 21:59:19

getting this error: Failure [INSTALL_FAILED_NO_MATCHING_ABIS]

@Manoranjan 2017-12-26 08:29:49

@IAmAndroid because you are using an APK file for a different architecture. Search google for more. (That was an old comment but replying because it might help others)

@Ramkesh Yadav 2018-07-07 11:57:07

i learnt new thing today, install app on emulator while draging apk to emulator , wow great :)

@Sobansky 2019-07-17 12:31:25

I had a problem with Drag & Drop installation but I have discovered something. If I rename apk installation file to shorted form and then use Drag & Drop everything works fine.

@Mubeen Iqbal 2017-12-16 05:10:08

Just drag and drop apk file in the emulator and done....

@Billa 2017-12-16 05:28:49

Add some more details to your answer. Else it is just like a comment and is considered low quality.

@Mubeen Iqbal 2017-12-20 05:47:40

Run your emulator and drag and paste your apk file in it ,it will automatically install apk and onclicking the icon it will run the application

@Pang 2018-11-13 05:00:48

This appears to be just a repeat of this existing answer.

@Amt87 2016-06-21 11:27:03

Nowadays, you can simply drag and drop the Android apk to the emulator and it will automatically starts installing.

@chad 2017-02-26 18:48:24

Is there something you need to do to enable this? Maybe it's different for the Visual Studio emulator, but drag and drop does not appear to work.

@Amt87 2017-02-27 07:55:44

I have never used that one.

@chad 2017-02-28 21:28:00

For others: drag and drop APK installs in Visual Studio Android Emulator do not work if the emulator was launched as Administrator. Who knows why.

@suther 2017-09-14 10:21:03

On Linux I do this:

  1. first see which devices I currently have: emulator -list-avds
  2. build the release cd android && ./gradlew assembleRelease
  3. install it at the emulated device "Nexus5" (you are inside the android directory, else use the full path to apk): adb -s '8e138a9c' install app/build/outputs/apk/app-release.apk

Thats it. You can also use ./gradlew installRelease

@Hassaan Akbar 2017-08-29 12:36:50

Now you can just drag and drop the apk in emulator and it will install!

@Pang 2018-11-13 05:00:20

This appears to be just a repeat of this existing answer.

@Thoman 2016-03-04 09:39:43

Simple You can upload APK to file hosting or download APK and use browser to install from unknown source .

@Faheem 2017-08-09 14:44:00

In mac or windows . Just run the emulator and Drag and drop the apk on the home screen . It will install

@Pang 2018-11-13 05:00:16

This appears to be just a repeat of this existing answer.

@Marcelo Agimóvel 2017-01-31 02:00:05

I might be wrong, but on Windows I simply drag and drop the .apk into Android Emulator. I mean, doing all mentioned above seems to be a lot of work.

@reformed 2017-01-31 02:24:09

Why post this answer if you are so unsure? Looks like you basically copied Amt87's answer.

@Marcelo Agimóvel 2017-01-31 04:03:17

I'm so unsure because i don't know if will work on his case. I can't see Amt87's answer.

@Chantell Osejo 2017-02-08 21:49:19

Super easy. Way easier than other answers, and it works great on OS X.

@Pang 2018-11-13 05:00:08

This appears to be just a repeat of this existing answer.

@Max 2016-05-30 13:16:24

Start the console (Windows XP), Run -> type cmd, and move to the platform-tools folder of SDK directory.

In case anyone wondering how to run cmd in platform-tools folder of SDK directory, if you are running a new enough version of Windows, follow the steps:

  1. Go to platform-tools through Windows Explorer.
  2. While holding shift right click and you will find the option "Open Command window here".
  3. Click on it and cmd will start in that folder.

enter image description here

Hope it helps

@shamnad 2016-04-20 05:23:03

1) paste the myapp.apk in platform-tools folder , in my case C:\Users\mazbizxam\AppData\Local\Android\android-sdk\platform-tools, this is the link in my case it may change to you people

2)open the directory in CMD CD C:\Users\mazbizxam\AppData\Local\Android\android-sdk\platform-tools

3)Now you are in platform-tools folder , just type adb install myapp.apk

please ensure that your emulator is turn on , if every thing is ok apk will install

@ORY 2016-02-11 12:29:04

Best way is to create a app, which opens the apk file on the emulator. You have to copy the .apk file to the download folder of your emulator. Then replace yourAppName.apk with your .apk name.

here is the code

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);



        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "yourAppName.apk")), "application/vnd.android.package-archive");
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);


    }
}

@Hamed Ghadirian 2014-11-24 15:05:54

Copy .apk file in your SDK's platform-tools/ directory,then install the .apk on the emulator by using cmd(on windows):

adb install <path_to_your_bin>.apk

or

./adb install <path_to_your_bin>.apk

If there is more than one emulator running, you can find all running emulators by this command:

adb devices

or

./adb devices

then you must specify the emulator upon which to install the application, by its serial number, with the -s option. For example:

adb -s emulator-5554 install path/to/your/app.apk

or

./adb -s emulator-5554 install path/to/your/app.apk

@user4566255 2015-06-15 12:15:16

you write the command on terminal/cmd adb install FileName.apk.

@Criss 2015-03-30 08:54:56

if use more than one emulator at firs use this command

adb devices

and then chose amulatur and install application

adb -s "EMULATOR NAME" install "FILE PATH"
adb -s emulator-5556 install C:\Users\criss\youwave\WhatsApp.apk

@Don Chakkappan 2014-12-14 10:27:32

From Windows 7 Onwards ,

Shift + Right click in your apk file folder.

Select Open Command Window Here

Type & Hit "adb install AppName.apk"

@N0mi 2014-09-19 12:15:47

(TESTED ON MACOS)

The first step is to run the emulator

emulator -avd < avd_name>

then use adb to install the .apk

adb install < path to .apk file>

If adb throws error like APK already exists or something alike. Run the adb shell while emulator is running

adb shell

cd data/app

adb uninstall < apk file without using .apk>

If adb and emulator are commands not found do following

export PATH=$PATH://android-sdk-macosx/platform-tools://android-sdk-macosx/android-sdk-macosx/tools:

For future use put the above line at the end of .bash_profile

vi ~/.bash_profile

@vikseln 2014-06-13 03:40:22

go to ADT/Android-sdk/tools directory in command prompt 1. adb install fileName.apk (Windows)

  1. ./adb install fileName.apk (Ubuntu/Linux or Mac)

@ravijena 2013-02-22 12:44:06

Download the Apk file from net and copy it to platform-tools of your SDK folder, then in command prompt go to that directory an type:

adb install filename.apk

press enter it will install in few seconds

@Salman Lashkarara 2014-01-11 13:58:07

In Genymotion just drag and drop the *.apk file in to the emulator and it will automatically installs and runs.

http://www.genymotion.com/

@Faakhir 2013-04-11 13:34:46

Let's suppose you have to install Facebook APK on your emulator.

You can use adb to install the APK to the running emulator in OS X like this:

./adb install ~/FBAndroid-2.1.apk

And on Windows, like this:

adb install %HOMEPATH%\FBAndroid-2.1.apk

Once complete, check the apps screen of the emulator to check that the app has been installed correctly. If you need to force the upgrade of this app from a previous version, add the -r flag, like this on OS X:

./adb install -r ~/FBAndroid-2.1.apk

@Akshat 2013-10-17 08:01:04

go to the android-sdk/tools directory in command prompt and then type

 adb install fileName.apk (Windows)

 ./adb install fileName.apk (Linux or Mac)

@duggu 2013-05-30 04:27:50

Goto Shell/Terminal/, reach at android-sdk/tools directory then

adb install fileName.apk // (u can run this command on windows)
or 
./adb install fileName.apk  //( u can run this command on linux)

Related Questions

Sponsored Content

102 Answered Questions

[SOLVED] Close/hide android soft keyboard

52 Answered Questions

33 Answered Questions

[SOLVED] How to avoid reverse engineering of an APK file?

56 Answered Questions

[SOLVED] How to fix 'android.os.NetworkOnMainThreadException'?

54 Answered Questions

[SOLVED] 'App not Installed' Error on Android

11 Answered Questions

[SOLVED] Install an apk file from command prompt?

  • 2011-08-16 09:38:32
  • Max
  • 529320 View
  • 406 Score
  • 11 Answer
  • Tags:   android cmd apk

8 Answered Questions

[SOLVED] Android error: Failed to install *.apk on device *: timeout

12 Answered Questions

[SOLVED] How to build an APK file in Eclipse?

Sponsored Content