Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
971 views
in Technique[技术] by (71.8m points)

android - Device chooser dialog is not showing up after instant run

In Android studio 2.0 after first app launch on emulator it seems that run process is attached to it. But if I connect device and want to test app, device chooser dialog is not showing up. I tried instant run, simple run, checked configurations (it's set to show chooser dialog), but all changes are made to emulator app.

How to launch app in device without turning off emulator and losing instant run "**connection**" with emulator ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This behaviour is clearly a shortcoming that's going to be fixed in subsequent releases, there's an open issue at AOSP.

Right now I found two workarounds that don't require studio restart or killing the adb process:

  1. Force close the app on the device you have the ongoing instant-run session. This way the session will be closed and you will be asked to choose the device after next run.

  2. Press the "debug" button if you've pressed the "run" button before and vice versa. For some reason, changing from run to debug or from debug to run forces AS to close the instant run session.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...