How do you install an APK file in the Android emulator?

前端 未结 30 2032
滥情空心
滥情空心 2020-11-22 14:53

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.

30条回答
  •  时光取名叫无心
    2020-11-22 15:13

    If you've created more than one emulators or if you have an Android device plugged in, adb will complain with

    error: more than one device and emulator
    

    adb help is not extremely clear on what to do:

    -d                        - directs command to the only connected USB device...
    -e                        - directs command to the only running emulator...
    -s         ...
    -p  ...
    

    The flag you decide to use has to come before the actual adb command:

    adb -e install path/to/app.apk
    

提交回复
热议问题