Debugging with Android Studio stuck on "Waiting for a debugger" forever

UPDATE The supposed duplicate is the question of getting stuck in “Waiting for a debugger” while executing Run , while this question is of getting stuck in “Waiting for a debugger” while executing Debugging, the steps to create a problem are different and the solution is also different .




Whenever I try to use the Android Studio Debug feature, the Run status always gets stuck:

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 } 

So far, the device (Samsung Galaxy S3 Android 4.3) that I am debugging will display

enter image description here

This comes from Android Studio 0.8.8 to 1.0. And on the same computer, I can debug using Eclipse on the same device without any problems.

So the question is, what can I do to debug Android Studio?




Update: The same thing happens when debugging on a Nexus 7 (2013) running Android 5.0; and testing on another machine gave the same result. I cannot be the only one that has encountered this problem: - /




Update:. The bonus is open, because this problem is so annoying. Even reinstalling the application does not solve. Nexus 5 runs Cyano, Win7 64. ADB magazine reports:

 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 

In addition, I cannot find an easy way to disconnect and reset the ADB connection in Android Studio.

+76
android android-studio android-debug
Dec 12 '14 at 2:48
source share
29 answers

Both of my machines have JDK 8 installed, the debugging function is restored after installing JDK 7.0.71, and for the JAVA_HOME environment variable for the new JDK.

Guess what the compatibility issue is between Android Studio + ADB + JDK8 (Eclipse + ADB + JDK8 works great).

+11
Dec 14 '14 at 7:02
source share

On some machines / projects, the debugger does not connect automatically, so you need to manually connect it (master studio → Run → Attach the debugger to the Android process )

+57
Sep 14 '16 at 8:57
source share

Rebooting Android Studio fixes the problem for me.

+32
Sep 25 '15 at 4:57
source share

Reboot the test device, fix the problem for me.

+29
Feb 29 '16 at 13:00
source share

A similar question has been asked recently , and a solution can work for some and very quickly.

Removing the Intellij IDEA (Android Studio) .idea directory that contains configuration information for me:

  • Quit Android Studio
  • Go to the project you are trying to debug
  • Backing up any files inside .idea that you changed (if your project checks any of them in VCS)
  • Delete .idea directory
  • Open a project in Android Studio
+17
Jan 19 '17 at 19:09
source share

The debugger stopped connecting to me today, and nothing worked until I tried the following:

Go to the "Run", "Edit-Configurations", "Miscellaneous" section, uncheck the box "Skip installation if the APK has not changed" Apply, OK.

The debugger started connecting again.

+14
Jun 29 '16 at 17:27
source share

This problem occurs when you open several instances of Android studio, so you need to attach the debugger manually, as described above.

You may need to close other instances of Android Studio.

+7
Jul 13 '17 at 18:00
source share

When the device displays a message, go to Run-> Attach debbuger, then select debbuger. he will start work.

+6
Oct 31 '16 at 20:31
source share

I tried the top three rated answers, but could not. After rebooting my mobile device, the problem is resolved. No longer waiting for the debugger.

+5
May 26 '18 at 11:17
source share

How it worked for me.

1 Launch Android Device Monitor from Tools → Android → Android Device Monitor

2 Click Stop for the process that you encountered a problem from the list of devices.

+4
Mar 04 '17 at 18:25
source share

I ran into this problem in Android 3.0. The device has just restarted .

+3
May 30 '18 at 6:28
source share

After clicking on the start icon. If it is stuck waiting for debugging, it means that it is not connected to the application. You must manually connect by clicking on the Attach Debugger on the Android process. It is located to the right of the launch icon. I linked this icon in the linked image .

+3
Oct 07 '18 at 18:19
source share

In most cases, this is caused by overloading resources and threads over the emulator. Or even to lock objects that GC cannot install for free: http://developer.android.com/intl/pt-br/tools/debugging/index.html

Typically, a single restart will solve the problem, but sometimes it asks for a restart of the IDE, so be sure to run both tests.

Another good test is trying to run the application in "Initial mode", and then try debugging mode again ...

PS: Remember to kill every debugging process in the IDE after each test. This will prevent overloading your env.

+2
Mar 20 '16 at 15:00
source share

This solution works for me:

disable USB debugging from device settings and then turn it back on.

its much faster and easier than restarting the device.

+2
Jul 02 '16 at 6:53
source share

This fixed it for me. Android Studio -> File -> Invalid Caches and Restarts ...

+1
Sep 21 '17 at 0:15
source share

I had the same problem. Reboot my Android device and close the adb.exe process. With this I could solve the problem

0
Jan 29 '16 at 2:50
source share

Rebooting didn't work for me. The work of DID waited a few minutes until Android Studio leaked itself. This was the first time I started the debugger; After that, Android Studio quickly released a debugger.

0
02 Sep '16 at 6:09
source share

For me Run-> Attach a debugger to the Android process, but I had to do this every time the application was launched.

Fix: There may be a problem with your “application launch configuration” (to make sure this creates a new project, to make sure that it works fine). Just delete the application configuration, open the MainActivity file and run → Debug (a new conformity will be created)

0
Jan 13 '17 at 5:41 on
source share

Well, I think there are many circumstances that can cause this problem. Instead, I use IntelliJ Idea, but basically it is similar to Android Studio. My solution for this problem:

The fastest way:

Right-click the class file containing the main action of your project, and then “Debug WhateverActivity.” This will create a new launch configuration that should debug well.

Another solution without creating a new launch configuration:

  • Open the Run / Debug menu and in the “Android app” select the configuration that you use to debug your app.
  • Find "Launch Options / Launch" there and set "Specified Activity" instead of "Default Activity".
  • In the "Launch" field, just below the above option, click the button with three buttons (three dots) and select the main activity.

At least it worked for me. I hope this works for others as well.

0
Aug 17 '17 at 11:03 on
source share

Fixed according to this solution: https://youtrack.jetbrains.com/issue/IDEA-166153
I opened <project dir>/.idea/workspace.xml replaced all <option name="DEBUGGER_TYPE" value="Auto" /> entries in <option name="DEBUGGER_TYPE" value="Java" />
and restarted Android Studio

0
Oct 08 '17 at 20:05
source share

Open a command prompt and go to android sdk> platform-tools> adb kill-server

press enter

and again adb start-server

press enter

0
Nov 19 '17 at 20:13
source share

Sometimes this is due to the fact that in the build.gradle configuration you need to install the node:

  debug { debuggable true } 

Change it to false when you need to prepare a signed apk.

respectfully

0
Feb 22 '18 at 19:17
source share

Without these solutions, it worked for me.

In my case, it was that I was debugging an application from Intellij IDEA and simultaneously with Android Studio. Just closing Intellij IDEA and uninstalling the application, I debugged only the fixed problem.

0
Mar 08 '18 at 15:34
source share

I just dealt with this problem after several days of trying the solution above. Therefore, I closed the emulator, launched the AVD dispatcher and in the device menu I selected - "erase data". So, in the next run, I was free from a stuck debugger. AVD manager

0
May 09 '18 at 20:41
source share

It happened to me that he stayed in "Waiting for Debugger" when I accidentally tried to debug the Release assembly, sometimes he warns that this is not a debug assembly, and others are silent in "Waiting for Debugger".

Obviously the decision to switch to Debug build

0
Jun 24
source share

Android Studio 3.0 and above

Disable Instant Launch

enter image description here

0
Jul 11 '18 at 13:51
source share

adb kill-server and adb start-server worked for me. Try disabling and enabling usb debugging on your phone. Also try revoking debug permissions and turning it back on

0
Dec 06 '18 at 5:22
source share

If all else fails, try "Clear Storage" through the System Preferences application.

0
Feb 24 '19 at 12:09 on
source share

Just use this command to disable it. adb shell am clear-debug-app

0
Jun 11 '19 at 10:31 on
source share



All Articles