257

UPDATE The supposed duplicate is a question on being stucking in "Waiting For Debugger" when executing Run, while this question is on being stucking in "Waiting For Debugger" when executing Debug, the steps to produce the problem is different, and the solution(s) are different as well.


Whenever I try to use Android Studio's Debug function, the Run status would always stuck at:

Launching application: com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity. DEVICE SHELL COMMAND: am start -n "com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity } 

While the device (Samsung Galaxy S3 Android 4.3) I'm debugging would display

enter image description here

This has being the case from Android Studio 0.8.8 all the way to 1.0. And on the same computer I can perform debugging using Eclipse on the same device without any issues.

So the question is what can I do to make Android Studio debugging work?


Update: The same thing happens when debugging on Nexus 7 (2013) running Android 5.0; and testing on another machine rendered the same result. I can't be the only one encountering this issue :-/


Update: Opened a bounty since this issue is so annoying. Even re-installing the app doesn't solve. Nexus 5 running Cyano, Win7 64. The ADB log is telling:

8568-8568/it.myapp:myprocess W/ActivityThread﹕ Application it.myapp is waiting for the debugger on port 8100... 8568-8568/it.myapp:myprocess I/System.out﹕ Sending WAIT chunk 

Also, I can't find an easy way to disconnect nor reset ADB connection in Android Studio.

10
  • If you haven't already, you could try unchecking "Use Host GPU" in the AVD Config for your emulator. Commented Dec 12, 2014 at 3:42
  • 2
    @JosephWebber Thanks for the suggestion, but I'm debugging on an actual hardware though Commented Dec 12, 2014 at 4:02
  • are you using a custom mod or stock one? Commented Feb 9, 2015 at 21:24
  • 1
    I tested on Nexus 7 2013 with stock Android 4.4.2, and Samsung S3 with Android 4.3, neither worked. Commented Feb 10, 2015 at 1:05
  • Hi, I got similar issue, I have try solution here but not work. Please help answer my question: stackoverflow.com/q/40838494/5241603 Commented Nov 29, 2016 at 3:14

45 Answers 45

1
2
1

Well, I guess there is a plethora of circumstances that can trigger this issue. I'm using IntelliJ Idea instead, but it's mostly the same than Android Studio. My solution for this problem:

Fastest way:

Right click on the class file that contains the main activity of your project, and then on "Debug 'WhateverActivity'". This will create a new run configuration that should debug fine.

Other solution, without creating a new run configuration:

  1. Open Run/Debug configurations and within "Android app" pick the configuration you're using to debug your app.
  2. Locate "Launch Options/Launch" there and set it to "Specified Activity" instead of "Default Activity".
  3. In the "Launch" field just below the aforementioned option, click on the three ellipsis (three dots) button and select your main activity.

At least it worked for me. I hope it works for others too.

Sign up to request clarification or add additional context in comments.

1 Comment

As a side note, beware with USB hubs and low quality USB cables. I've experienced this sort of problem due these too.
1

Non of this solutions worked for me.

In my case was that I was debugging an App from Intellij IDEA and at the same time with Android Studio. By just closing the Intellij IDEA and removing the app I was debugging just fixed my problem.

Comments

1

Make sure that your Active Build Variant is debug.

enter image description here

If you also want to make your release variant APK debuggable then make a simple change in app level build.gradle -

buildTypes { release { debuggable true /*Your rest code*/ } } 

Comments

1

Change your time zone and region format. unfortunately, some regions are restricted.

Comments

1

In my case manually deleting the previously installed app(package) solved the issue: adb shell pm list packages adb uninstall com.something.myapp.test

Comments

0

Restarting everything didn't work for me. What DID work was waiting for a few minutes while Android Studio unclogged itself. This was the first time I ran the debugger; after that, Android Studio fired up the debugger quickly.

Comments

0

For me Run->Attach debugger to Android process was working, but I had to do it every time app was launched.

Fix: There may be a problem with your 'App launch configuration'(To verify this create new project to see if it's working fine). Just delete app configuration, open MainActivity file and Run->Debug (new conffiguration will be created)

Comments

0

Sometime it's due to the fact that in the build.gradle configuration you have to set the node:

 debug { debuggable true } 

Change it back to false when you have to prepare the signed apk.

Regards

Comments

0

It has happened to me that it stayed stuck in "Waiting for Debugger" when accidentally I tried to Debug a Release build, sometimes it warns that it is not a debug build and others it silently stucks in "Waiting for Debugger".

The solution is obviously to switch to Debug build

Comments

0

For my case, I have to reinstall the AVD.

Comments

0

Seems this is another Android Studio bug. To prevent this problem return back to Android Studio v4.1.3 (4.1.1) or earlier and use Android Gradle Plugin Version 4.1+ and Gradle Version 6.6 . After this, android studio works fine. Say if this answer is useful, Thanks.

Comments

0

In my Linux Ubuntu Android Studio development environment, entirely deleting my configuration folder, ~/.config/Google/AndroidStudio2021.1, and restarting Android Studio was the only way to restore native debugging ability.

Comments

0

Toggling airplane mode on the device fixed it for me (without doing a reset)

Comments

0

For MAUI: you'll get an indefinite hang waiting for debugger to attach if you have both visual studio and android studio open at the same time.

Comments

-3

If all else fails, try "Clean Storage" via the app's System Settings.

2 Comments

System Settings is not part of an app.
launcher > Settings > Apps > my_app > Storage > Clean storage
1
2

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.