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

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

    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.

提交回复
热议问题