Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Changing deployment target when instant run is enabled

Is there no easy way to change my deployment target when instant run is enabled? For example, I have two emulators running at the same time on my mac, one is genymotion API 22 and one which is genymotion API 16.

I have already unchecked this box as I would like to deploy my build to my api 16 emulator:

enter image description here

But the Play icon with the flash still appears in the toolbar and when I click it, it just deploys to my genymotion API 22:

enter image description here

I have to go into Preferences, then search for "instant run", and then untick the box that says "Enable instant run" before I can move my build to API 16.

Is there no easier way to change deployment target when instant run is enabled?

like image 876
Simon Avatar asked Apr 14 '16 17:04

Simon


People also ask

How do I turn off instant run?

By default, Instant Run is enabled when you first install Android Studio. Uncheck the "Enable Instant Run to hot swap code/resource changes on deploy (default enabled)" option and then click on the "OK" button to disable Instant Run.

Does Android Studio still have instant run?

We Want Your Feedback! Instant Run is currently available only in Android Studio 2.0, and higher. We will continue to improve the feature in subsequent releases. If you run into any additional issues, please help by logging bugs in our public Issues Tracker.


2 Answers

Clicking on stop "app" button works for me - you get to choose a different target device, but at the cost of application being killed on the current device.

The button looks like this: stop app button

Another option is to switch to debug "app" (if you're currently running your app), or run "app" (if you're currently debugging) - you'll get a dialog asking whether it is fine to restart the app, and once you "ok" this dialog you'll get to choose the next deployment target (note that you don't actually have to deploy debug version - all you had to do is "ok" the dialog).

I'm pretty sure that this small, but very annoying problem will be solved soon.

like image 157
Vasiliy Avatar answered Sep 20 '22 02:09

Vasiliy


Vasily's answer didn't work for me. What I found is disconnecting the device your working with. When it's a real mobile device disconnect the usb cable, when working with the emulator quit the emulator.

like image 32
Olivier de Jonge Avatar answered Sep 21 '22 02:09

Olivier de Jonge