简体   繁体   中英

Android Studio: the debugger detaches but the app stops too

I've been looking for some information about an issue related with the debugger on Android Studio (I'm using 2.2.3 version) and I have found this two links:

How to stop debug without closing app in Android Studio 2

unanble to detach debugger from Android Studio 2.2.3

They say that, in order to detach debugger and keep on running the app, you should click on "Close" button instead of "Stop" button, but this doesn't work for me. When I click "Close" button I get a dialog like this:

Android调试器正在运行

I keep unchecked the "Terminate the process after disconnect" option, but when I click on "Disconnect" the debugger detaches, which is correct, but the application stops too, which I guess it's not the expected result.

Any idea? Is this a bug in the latest version of Android Studio? Perhaps that functionality does not longer exist or maybe it is now attached to another button?

Thanks in advance.

David.

I have just updated to 2.3 version of Android Studio and I think this issue is solved now:

  1. If you run the app in debug mode, red square button will detach the debugger and will stop the app too. So don't run your app in debug mode, but in normal mode (Run app).
  2. Then go to Run > Attach debugger to Android process, select the application on the list and click OK.
  3. Now, if you move the mouse over the red square button you'll get the message "Stop Android Debugger". Click on it and the debugger will detach but the app won't stop, which is the expected result :)

I don't really know if this worked lin the previous version too, but anyway this is how the debugger can be detached without stopping the app.

Bye!

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