I am on a mac running 10.13.5 and Android Studio 3.2.1. Gradle is gradle-4.6-all.zip.
This started after updating Android Studio to 3.2.1.
It seems that whenever app crashes or if device goes to sleep(testing on real device) when I try to rerun the app I get either the 'A debugger is already attached' or a series of lines of
Waiting for application to come online: ...
followed by:
Could not connect to remote process. Aborting debug session.
Clicking on the red 'Stop' icon before attempting to rerun the app with debugger doesn't help.
I have used adb kill-server, adb start-server with no luck.
I have tried restarting app on device and then clicking on the 'Attach debugger to Android Process' icon but I get:
Error running 'Android Debugger (8600)': Unable to open debugger port (localhost:8600): java.net.SocketException "Connection reset"
The only way to get back to being able to rerun the app in debug mode is to exit and then restart Android Studio.
Any suggestions?