简体   繁体   中英

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:

在此输入图像描述

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:

在此输入图像描述

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?

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: 停止app按钮

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM