Android Studio调试功能突然失效,寻求技术解决方案
Hey Sharon, sorry to hear your debug mode suddenly stopped working—this is super frustrating when you’re deep into troubleshooting. Let’s walk through the most common fixes that usually resolve this "Waiting for debugger" loop:
常见修复步骤
重启核心组件
- First off, restart both your emulator and Android Studio. Sometimes the problem is just a stuck process, and a quick reboot clears it right up. Give debugging another shot after restarting—you might be surprised how often this works.
- Double-check that USB debugging is enabled in your emulator’s Developer Options. Even for emulators, this toggle can sometimes flip off unexpectedly. If Developer Options isn’t visible, go to Settings → System → About Device and tap the build number 7 times to unlock it, then go back to enable USB debugging.
Clean up project caches and rebuild
- Head to the top menu:
Build→Clean Project, then once that’s done,Build→Rebuild Project. Corrupted cache files are a frequent culprit for weird debug issues. - For a deeper clean, delete the
.gradleand.ideafolders in your project root directory, then click theSync Project with Gradle Filesbutton (the elephant icon in the toolbar). Just make sure to back up any custom configs before deleting these folders!
- Head to the top menu:
Tweak debug configurations
- Open
Run/Debug Configurations(from the top-right dropdown menu, selectEdit Configurations):- Confirm the
Moduleis set to your correct app module; - Switch to the
Debuggertab, setDebug typetoAutoorJava(native debugging mode can sometimes cause connection hiccups); - Make sure
Skip all breakpointsisn’t checked—accidentally enabling this can make it look like the debugger isn’t connecting.
- Confirm the
- Open
Reset ADB connection
- Open Android Studio’s Terminal and run these commands:
ADB (Android Debug Bridge) often loses its connection to the emulator, and restarting the service fixes it. You can also runadb kill-server adb start-serveradb devicesto verify if the emulator shows up as "device" (not offline). If it’s offline, restart the emulator and recheck.
- Open Android Studio’s Terminal and run these commands:
Verify debug permissions in your project
- Check your
AndroidManifest.xml—addandroid:debuggable="true"inside the<application>tag (though Android Studio usually adds this automatically for debug builds, manually setting it won’t hurt). - Open your module-level
build.gradleand ensure the debug build type hasdebuggableset totrue:buildTypes { debug { debuggable true } release { // Your release config here } }
- Check your
Update tools and test a new emulator
- Open SDK Manager and make sure Android Studio, SDK Platform-Tools, and your emulator system images are all up to date. Old tool versions can cause compatibility bugs.
- Try creating a brand-new emulator (with a different device model or Android version). If debugging works on the new emulator, your original emulator image is probably corrupted.
If none of these fix it, check the Logcat window in Android Studio when you try to start debugging—look for crash logs or permission errors. Those will give you more specific clues about what’s going wrong.
内容的提问来源于stack exchange,提问作者Sharon
相关产品推荐
相关产品推荐

