While debugging an Android app you are used to seeing the Waiting for debugger dialog. This dialog is shown until the debugger attaches to the process of the app you want to debug, to let you debug it.
Sometimes, for various unknown and strange reasons, may happen that this dialog won’t go away, and so you are unable to continue your debugging session.
A solution could be to reboot your device/emulator and also kill/restart Android Studio. This is quite a heavy solution that makes you lose a lot of time.
You can avoid all these restarts just by running the following code in your terminal:
adb shell am clear-debug-app
Doing so should clear any broken reference that ADB might have with your app, so you can now launch a new debug session and you will see the infamous dialog to disappear!