Android Studio 2.0 launch APK on another device

大城市里の小女人 提交于 2019-12-10 12:30:50

问题


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.


回答1:


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

Connect your device and select it.




回答2:


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




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/36592424/android-studio-2-0-launch-apk-on-another-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!