How to install an apk on the emulator in Android Studio?

AndroidAndroid Studio

Android Problem Overview


How do you install an apk on the emulator in Android Studio from the terminal?

In Eclipse we did

/home/pcname/android-sdks/platform-tools/adb -s emulator-5554 install /home/pcname/Downloads/apkname.apk

Now how about in Android Studio?

Android Solutions


Solution 1 - Android

Run simulator -> drag and drop yourApp.apk into simulator screen. Thats all. No commands.

Solution 2 - Android

EDIT: Even though this answer is marked as the correct answer (in 2013), currently, as answered by @user2511630 below, you can drag-n-drop apk files directly into the emulator to install them.


Original Answer:

You can install .apk files to emulator regardless of what you are using (Eclipse or Android Studio)

here's what I always do: (For full beginners)

1- Run the emulator, and wait until it's completely started.

2- Go to your sdk installation folder then go to platform-tools (you should see an executable called adb.exe)

3- create a new file and call it run.bat, edit the file with notepad and write CMD in it and save it.

4- copy your desired apk to the same folder

5- now open run.bat and write adb install "your_apk_file.apk"

6- wait until the installation is complete

7- voila your apk is installed to your emulator.

Note: to re-install the application if it already existe use adb install -r "your_apk_file.apk"

sorry for the detailed instruction as I said for full beginners

Hope this help.

Regards,

Tarek

Example 1

Example 2

Solution 3 - Android

For those using Mac and you get a command not found error, what you need to do is

type

./adb install "yourapk.apk"

enter image description here

Solution 4 - Android

Start your Emulator from Android Studio Tools->Android-> AVD Manager then select an emulator image and start it.

After emulator is started just drag and drop the APK Very simple.

Solution 5 - Android

Just drag APK file to android emulator it will install automatically.

Solution 6 - Android

In android studio emulator to run an apk file just drag the apk into the emulator.The emulator will install the apk

Solution 7 - Android

Much easier is just to start your emulator, then go to sdk/platform-tools and use adb from there to install apk. Like:

adb install xxx.apk

It will install it on running emulator.

Solution 8 - Android

Drag and drop apk if the emulator is launched from Android Studio. If the emulator is started from command line, drag and drop doesn't work, but @Tarek K. Ajaj instructions (above) work.

Note: Installed app won't automatically appear on the home screen, it is in the apps container - the dotted grid icon. It can be dragged from there to the home screen.

Solution 9 - Android

For Linux: once emulator is running, the following worked for me.

Because I installed the Android SDK on my home directory, I have the following file structure:

  • home/Android/Sdk/platform-tools/adb

  • home/AndroidStudioProjects/Metronome.adk

AndroidStudioProjects is a file folder I made for my Android projects. "Metronome.adk" is the file I want to run.

So, using Terminal from the home directory...

./Android/Sdk/platform-tools/adb install ./AndroidStudioProjects/Metronome.adk

Being a Linux novice, I often forget the need to put the "./" in when trying to locate a file or run a command.

After the command achieves "Success", the app is in the Apps area of the emulator and can be run.

Solution 10 - Android

Just download the apk from talkback website

Drag the downloaded apk to the started emulator, Go to settings on emulator > Search for talkback, you will now find it there

Solution 11 - Android

enter image description here

When you start Android studio Look for Profile or Debug apk.

After clicking you get the option to browse for the saved apk and you will be able to later run it using emulator

If Android Studio is already open:

Click on File you can find Profile or Debug apk in this menu too

Solution 12 - Android

1.Install Android studio. 2.Launch AVD Manager 3.Verify environment variable in set properly based on OS(.bash_profile in mac and environment Variable in windows)

  1. launch emulator
  2. verify via adb devices command. 6.use adb install apkFileName.apk

Solution 13 - Android

In Android Studio: View - Tool Windows - Gradle

In the Gradle tool window navigate to your :app - Tasks - install and then execute (by double-clicking): any of your install*tasks: e.g. installDebug, installRelease

Note: the apk will also automatically installed when you Run your application

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionstackoverflowView Question on Stackoverflow
Solution 1 - Androiduser2511630View Answer on Stackoverflow
Solution 2 - AndroidTarek K. AjajView Answer on Stackoverflow
Solution 3 - AndroidKim StacksView Answer on Stackoverflow
Solution 4 - AndroidAbhijit ChakraView Answer on Stackoverflow
Solution 5 - AndroidPrashant SharmaView Answer on Stackoverflow
Solution 6 - Androidbaswaraj View Answer on Stackoverflow
Solution 7 - AndroidEvgeniy SpinovView Answer on Stackoverflow
Solution 8 - AndroidMitchView Answer on Stackoverflow
Solution 9 - AndroidPhil FreihofnerView Answer on Stackoverflow
Solution 10 - AndroidSUPARNA SOMANView Answer on Stackoverflow
Solution 11 - AndroidMeenoharaView Answer on Stackoverflow
Solution 12 - AndroidjayeshView Answer on Stackoverflow
Solution 13 - AndroidTmTronView Answer on Stackoverflow