Android Studio
Debugging
Waiting For Debugger
Troubleshooting
App Development

Debugging with Android Studio stuck at Waiting For Debugger forever

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

When an Android app sits on "Waiting For Debugger" forever, the process usually launched in debug mode but the debugger never attached correctly. The fix is rarely inside your business logic. It is usually an ADB, device, process, or run-configuration issue.

What the Message Means

That message appears when the app process is paused waiting for a JDWP debugger connection. If Android Studio cannot attach, the app just sits there.

Common causes include:

  • stale ADB state
  • wrong process or run configuration
  • a previous debugger session still hanging around
  • device-side "wait for debugger" developer option
  • mismatched debug build or signing state

First Checks

Start with the fastest resets:

bash
1adb devices
2adb kill-server
3adb start-server
4adb shell am force-stop com.example.app

Then:

  1. unplug and reconnect the device if using USB
  2. verify the device is authorized for debugging
  3. confirm you are launching a debug build, not release
  4. try Run once, then Debug

This clears a surprising number of stuck sessions.

Check the Run Configuration

In Android Studio, confirm the selected app module and debugger type are correct. If the wrong process is targeted or the wrong variant is selected, the IDE may wait on an attach target that never becomes ready.

Also inspect the manifest and Gradle setup to ensure the build is actually debuggable in the chosen variant.

Device Developer Options Can Interfere

On the device, there is a developer option named "Wait for debugger" or similar behavior depending on Android version. If that was enabled manually for your package, the app may pause even when Android Studio is not attaching the way you expect.

If debugging has become stuck repeatedly:

  • disable that device option
  • clear the selected debug application on the device
  • relaunch from Android Studio cleanly

Logcat and Process Checks

Use logcat to see whether the app is crashing early or whether it really is just waiting:

bash
adb logcat | grep -i com.example.app

Sometimes the app never reaches the point where Studio expects to attach because it crashes during startup, and the visible symptom still looks like debugger trouble.

You can also inspect running processes:

bash
adb shell ps | grep com.example.app

If the process appears and disappears immediately, the issue may be a startup crash rather than debugger attach failure.

Clean State If Needed

If the project state is suspicious, try:

  • clean and rebuild the project
  • uninstall the app from the device
  • invalidate IDE caches only if simpler fixes fail

Reinstalling helps when an old app process, incompatible install, or stale debug session is confusing the tooling.

Common Pitfalls

The biggest mistake is assuming "Waiting For Debugger" means the debugger is working and your code is the problem. Often the debugger is not attached at all.

Another mistake is debugging the wrong build variant. A release variant or a non-debuggable configuration will not behave as expected.

A third issue is forgetting device-level developer settings. The phone can be forcing debugger wait behavior independently of the IDE.

Summary

  • The message means the app is paused waiting for debugger attach.
  • Start by resetting ADB, the app process, and the USB or device connection.
  • Verify the selected module, process, and debug build variant.
  • Check device developer options for package-level wait-for-debugger behavior.
  • Use logcat to distinguish debugger attach failure from an early app crash.

Course illustration
Course illustration

All Rights Reserved.