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

后端 未结 13 2087
温柔的废话
温柔的废话 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 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

提交回复
热议问题