Android Studio 2.0 launch APK on another device
Asked Answered
C

4

16

Since Android Studio 2.0 and its reworked "build / run" mechanism, I can't "launch" an APK on a second device anymore. Once the APK has been loaded on the first device, I can't choose to launch a build to another device.

"Run" will target the current device "Re-run" will stop the application running on the current device and upload it to the "second" device.

So my question is : "How can I launch a "second" build targeting a different device than the first device I builded on without terminating the first process ?"

Sorry for my bad english, this is not my native language.

Cavendish answered 13/4, 2016 at 8:14 Comment(2)
The highest voted answer (not the accepted answer) provides a better solution.Suspicion
Nope, it stops the app from running in the first instance, which I don't wantCavendish
A
8

Disconnect the device, click on the "play" button. Android Studio ask you now where to run the app.

Connect your device and select it.

Amerind answered 13/4, 2016 at 8:26 Comment(3)
If you click the stop button (Red Square), the Instant Run is deactivated. Then click the Run button the list of devices appears again.Indonesian
It'd kill the current process on the emulator ; something I doesn't wantCavendish
That's a bad solution, because USB connector would be ruined quickly.Placebo
I
27

If you click the stop button (Red Square), the Instant Run is deactivated. Then click the Run button the list of devices appears again.

The drawback is that when you click on the stop button the application is killed on the current running device.

We need a way or a shortcut to bypass Instant Run

Indonesian answered 17/4, 2016 at 14:53 Comment(4)
This one is elegantClyster
This answer should be accepted, as it's much easier than disconnecting and reconnecting the device, let alone restarting the emulator.Staceestacey
It seems that the red square does not kill the app anymore; as a consequence the app is still launched on the same device. (user of OnePlus 3T)Hexameter
Earlier it used to work, even that is not working in Updated Android Studio 3.1.2Pernas
A
8

Disconnect the device, click on the "play" button. Android Studio ask you now where to run the app.

Connect your device and select it.

Amerind answered 13/4, 2016 at 8:26 Comment(3)
If you click the stop button (Red Square), the Instant Run is deactivated. Then click the Run button the list of devices appears again.Indonesian
It'd kill the current process on the emulator ; something I doesn't wantCavendish
That's a bad solution, because USB connector would be ruined quickly.Placebo
P
6

On of the helpful method I found through which at-least you don't have to disconnect your already connected device to run the app on another device.

Click on the arrow down icon near to run option and select Edit Configuration. It will open Run/Debug configuration dialog box, uncheck the checkbox "Use same device for future launches".
Next time when you will hit the run button, Android Studio will ask you to select the device.

enter image description here

enter image description here

Pernas answered 11/5, 2018 at 7:7 Comment(0)
B
3

When you deploy to your first device, make sure you have not selected to launch on the same device for future launches. Untick in your case.

Should you have already had this option on, and it is running on the same device, then unplug the device it is launching on, or turn off the emulator.. and it will ask you which device you now want to launch on.

enter image description here

Bacchius answered 13/4, 2016 at 8:26 Comment(3)
@NinoLenoska Not sure how that is the case. You accepted an answer that is the same, just briefer. My answer is also to unplug the device and re-run. And how to prevent it launching on the same device in the first place.Bacchius
@Doomsknight Whether "Use same selection for future launches" is ticked or not won't change anything... The other solution was more concise and preciseCavendish
@NinoLenoska You should upvote the other answer if it helped you.Bacchius

© 2022 - 2024 — McMap. All rights reserved.