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

后端 未结 13 1913
温柔的废话
温柔的废话 2020-12-02 05:24

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 em         


        
相关标签:
13条回答
  • 2020-12-02 05:55

    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 bale to later run it using emulator

    0 讨论(0)
  • 2020-12-02 05:57

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

    0 讨论(0)
  • 2020-12-02 06:02

    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) 4. launch emulator 5. verify via adb devices command. 6.use adb install apkFileName.apk

    0 讨论(0)
  • 2020-12-02 06:04

    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

    0 讨论(0)
  • 2020-12-02 06:04

    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

    0 讨论(0)
  • 2020-12-02 06:06

    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.

    0 讨论(0)
提交回复
热议问题