Debugging with Android Studio Stuck at "Waiting for Debugger" Forever

Debugging with Android Studio stuck at Waiting For Debugger forever

Both of my dev machines have JDK 8 installed, the debugging function is restored once JDK 7.0.71 was installed and JAVA_HOME environmental variable was set to point to the new JDK.

Guess there's some compatibility issue between Android Studio + ADB + JDK8 (Eclipse + ADB + JDK8 works fine).

Why Android Studio says Waiting For Debugger if am NOT debugging?

I've ran into this issue in the past and again today. In my case the problem is resolved by a device reboot. After a clean boot I can again run the application and the "Waiting for Debugger" prompt does not appear.

Forever Waiting for application to start debug server when debugging a WatchFace

I'm afraid there's no real solution other than what you've already found: start the watch face normally and then attach the debugger to it. As you surmised, the issue is that the debugger is waiting for an Activity to start; since the watch face is based on a Service instead, this never occurs.

However, there are a couple of tricks you can use to help with debugging watch face startup code. Here's one approach:

  1. Put breakpoints in your startup code as needed, then run the watch face normally.
  2. Attach the debugger to your watch face.
  3. Switch to a different face on the watch. The debugger should remain attached as long your process is alive on the watch, and you'll have a good few seconds until the system kills it.
  4. Switch back to your own face. All your startup code should run at this time.

If this doesn't work, an alternate technique is to create a "dummy" activity in your app, debug that using Shift-F9 from Android Studio, then set your watch face. Again, all your startup code should then run after the debugger session is established.

NOTE: one other annoyance you'll find when debugging watch faces is that the OS will kill your process as an ANR after just a few seconds stopped in the debugger. I haven't found a workaround to this other than to just be quick!

Waiting for Debugger message stuck when debug app

Enable android ndk and ndk workspace support in file->setting->plugins



Related Topics



Leave a reply



Submit