Device chooser dialog is not showing up after instant run

后端 未结 6 862
盖世英雄少女心
盖世英雄少女心 2020-12-20 11:49

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,

相关标签:
6条回答
  • 2020-12-20 11:56

    Till the issue is solved, you can do this.

    In the run menu, there is an option as 'Stop app'. Using that you can force stop your app. Running again you will get the device chooser option.

    Your app will be present in your earlier device or emulator. You will just have to re-launch it. (If you do not want to run again on the earlier device.)

    0 讨论(0)
  • 2020-12-20 11:59

    February 2018 answer: Try to disable Instant run from the Settings, it worked for me on Android-studio v.3.0.1

    1. Open the Settings or Preferences dialog: On Windows or Linux, select File > Settings from the menu bar. (On Mac OSX, select Android Studio > Preferences from the menu bar.)
    2. Navigate to Build, Execution, Deployment > Instant Run.
    3. Uncheck the box next to Restart activity on code changes.

    0 讨论(0)
  • 2020-12-20 12:00

    Go to Run>Edit Configurations > Deployment Target Options and uncheck "Use same device for future"

    0 讨论(0)
  • 2020-12-20 12:09

    Go to Task Manager and kill the adb.exe process.

    This will detach the android studio with the running emulator. You can then again run the program and you will see the device chooser.

    0 讨论(0)
  • 2020-12-20 12:15

    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.

    0 讨论(0)
  • 2020-12-20 12:16

    Instant Run has nothing to do with emulator or devices, it will perform its action on whosoever you have selected.

    Just restart your android studio and connect your device and launch app ; Dialog will appear.
    When chooser dialog appears showing connected devices and emulators don't check "Use same device for future launches" to get this dialog every time you launch your app.

    Also, if you want to run on all devices hold on SHIFT and click each and run.

    0 讨论(0)
提交回复
热议问题