Reputation: 53873
I'm normally testing my android app on a physical device, but today I want to do some testing using an emulator. So I created one and it's running fine. I now want to install my app on my emulator. I normally install the app on my device using the Gradle task "installDebug". In the list of Gradle tasks I can't find anything which refers to the emulator though. Although this should be an easy thing to do, I can't find any place in Android Studio to do this.
So I found this question here on SO which explains a way to do it from the command line. Although I'm not afraid of the terminal it would be great if I can just do it from within Android studio/IntelliJ so it goes quick and easy.
Any tips on how to install my app on the emulator from within Android Studio (either using a Gradle task or not) would be great!
Upvotes: 0
Views: 2568
Reputation: 80010
Emulator instances act just like physical devices for the purposes of the installDebug
task in Gradle, in ADB, and the Android Debug Monitor. If you only have an emulator running and no physical device connected, most things will simply use the emulator by default without needing to ask you; if you have an emulator as well as devices, then you may need to choose which one to use in the same way you would if you had multiple physical devices.
Upvotes: 3