Waiting for debugger как убрать
Перейти к содержимому

Waiting for debugger как убрать

  • автор:

Debugging with Android Studio stuck at "Waiting For Debugger" forever

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:

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:

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

Android Solutions

Solution 1 — Android

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

Solution 2 — Android

On some machines/projects the debugger do not attach automatically so you need to attach it manually (studio menu -> Run -> Attach debugger to Android process)

Solution 3 — Android

Restarting Testing device fix the issue for me.

Solution 4 — Android

Restarting Android Studio fix the issue for me.

Solution 5 — Android

After clicking on the run icon. If it is stuck waiting for a debugger means it is not attached to the app. You have to manually attach by clicking on Attach Debugger to Android process. It is on the right side of the run icon. I had focus this icon in linked image.

Updated Image for Attach Debugger to Android process Icon

new Image for Attach Debugger icon

Solution 6 — Android

Debugger stopped connecting for me today and nothing worked until I tried the following:

Go to Run, Edit-Configurations, Miscellaneous Tab, uncheck ‘skip installation if APK has not changed’ Apply, OK.

Debugger started to connect again.

Solution 7 — Android

This problem occurs when you open more than one instance of Android studio, so you need to attach the debugger manually like mentioned above.

You may need to close other instances of Android studio.

Solution 8 — Android

A similar question has been asked recently and the solution may work for some and is very quick.

> Clearing the Intellij IDEA (Android Studio) .idea directory which > contains configuration information worked for me: > > 1. Exit Android Studio > 2. Navigate to the project you are trying to debug > 3. Backup any files inside .idea that you modified (if your project checks any of these into VCS) > 4. Delete .idea directory > 5. Open the project in Android Studio

Solution 9 — Android

I faced this problem in android studio 3.0. Just restarted device solved.

Solution 10 — Android

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).

Solution 11 — Android

I tried the top three rated answers but failed. After rebooting my mobile, the problem is solved. No more long «Waiting for Debugger».

Solution 12 — Android

I just managed this problem, after several days of trying the above solutions. So I closed the emulator, run AVD manager and in device menu choose — «wipe data» So in next run I was free from stucked debugger. AVD manager

Solution 13 — Android

When the Device displays the message go to Run->Attach debbuger, then select a debbuger. it’ll start the activity.

Solution 14 — Android

This fixed it for me. Android Studio -> File -> Invalidate Caches & Restart.

Solution 15 — Android

I had the same problem. Restart my android phone device worked for me.

Solution 16 — Android

This solution works for me:

turning off the USB debugging from my device settings , and then turning it on again.

its Much quicker and easier than restart the device.

Solution 17 — Android

How it worked for me.

1 Start Android Device Monitor from Tools -> Android -> Android Device Monitor

2 Click on Stop for the process you are facing the issue from list of devices.

Solution 18 — Android

Most of the times this is caused because of the overload of resources and threads over the emulator. Or even for the lock of objects that GC couldn’t set free: http://developer.android.com/intl/pt-br/tools/debugging/index.html

Usually, a single restart of it will solve the issue, but sometimes it asks for the IDE restart, so be sure to make both tests.

Another good test is trying to start the app in «Start mode» and then try the debug mode again.

P.S: Don’t forget to kill each debug process in the IDE after each test. This will prevent your env to be more overloaded.

Solution 19 — Android

Android studio 3.0 and Above

Disable the instant Run

enter image description here

Solution 20 — Android

As for my case, running Android Studio Canary (preview release) along with the stable version was the problem. Running multiple instances of the same Android Studio flavor was OK, but mixing them often resulted in «Waiting For Debugger».

Solution 21 — Android

For me, the issue was: The Regional Format of Windows was ARABIC. I simply changed the regional format to English (United States) and the error has fixed.

  1. Go to Start -> type Region -> click on Region to open Region window -> from the Format dropdown, select English (United Stated) -> Click OK.
  2. Restart Android Studio.

Region window

Solution 22 — Android

I had the same problem. Restart my android device and closed the adb.exe process. With that I could solve the problem

Solution 23 — Android

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:

> 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.

Solution 24 — Android

Got it fixed according this solution: https://youtrack.jetbrains.com/issue/IDEA-166153
I opened <project dir>/.idea/workspace.xml replaced all the
<option name=»DEBUGGER_TYPE» value=»Auto» /> occurrences to
<option name=»DEBUGGER_TYPE» value=»Java» />
and restarted Android Studio

Solution 25 — Android

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

and again adb start-server

Solution 26 — Android

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 —

Solution 27 — Android

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.

Solution 28 — Android

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)

Solution 29 — Android

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

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

Solution 30 — Android

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.

Solution 31 — Android

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

Solution 32 — Android

For my case, I have to reinstall the AVD.

Solution 33 — Android

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.

Solution 34 — Android

This also happens to me from time to time. Problem is that your app / device is configured to wait for debugger. In this case it is waiting for debugger before continuing execution of.

Option 1:
Option 2:
  1. Root of Developer Options
  2. Developer options -> Select debug app ->-> Wait for debugger

This was tested on Android emulator in android studio. Other phones might have this setting different. If you can not find app’s settings in debug, reinstalling app might work too.

Solution 35 — Android

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.

Solution 36 — Android

Tried all the solutions given here but restarting my laptop worked for me.

Solution 37 — Android

If all else fails, try «Clean Storage» via the app’s System Settings.

Previous Solution:

Where should ajax request be made in Flux app?

Next Solution:

How to join a slice of strings into a single string?

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Waiting for debugger как убрать

Solve ADB stuck on waiting for debugger

Emanuele Papa

While debugging an Android app you are used to seeing the Waiting for debugger dialog. This dialog is shown until the debugger attaches to the process of the app you want to debug, to let you debug it.

Sometimes, for various unknown and strange reasons, may happen that this dialog won’t go away, and so you are unable to continue your debugging session.

A solution could be to reboot your device/emulator and also kill/restart Android Studio. This is quite a heavy solution that makes you lose a lot of time.

You can avoid all these restarts just by running the following code in your terminal:

Doing so should clear any broken reference that ADB might have with your app, so you can now launch a new debug session and you will see the infamous dialog to disappear!

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

2 This is an issue with the Android device. Turn off and turn on the "USB Debugging" option from the Developer Options settings menu. Also make sure "Select debug app" has nothing selected. – Nj Subedi Jun 17 ’19 at 11:00 ,I uninstalled the app with which this issue was occurring. ,faster than rebooting is Just go to developer options and switch it off and on again (dont forget to check usb debugging option too), worked for me(Neuxs5).,Without restarting the device, I was able to fix this issue by going to "Developer Options" and then first "disabling" and then "enabling"-

Please try this command to disable it.

Answer by River Sweeney

In Debug mode Android Studio connects to your Device via socket(:8600). Somehow your socket connection is choked and thus not responding to incoming connections., kishan patel 3 Years ago In Debug mode Android Studio connects to your Device via socket(:8600). Somehow your socket connection is choked and thus not responding to incoming connections. Restart Android Studio and your problem will be resolved ,Go to Run menu ====> click on Edit Configurations ====> Micellaneous and finaly uncheck the option Skip installation if APK has not changed,Have read alot about this and the only solution that worked for me was to create a new project and then copy old project back into it.

Whereas in the Eclipse console I get these set of messages

Answer by Walker Townsend

Debug with vscode provided that android studio is not open,I must say it works WAY better now, since I closed Android studio!! It now works great every time!,By the way the application works if I use android studio.,I can share the whole file but I do not know how, I am new to android world sorry 🙂 Is there any way to export or where is file location?

Answer by Manuel Gilbert

Answer by Zain Howell

Inside Android Studio 2.0 and above, there is an option of Attach Debugger to Android Process. It is the last menu item in the Run menu.,I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build — the application does not run; though it does get installed on the device. On the device I get this message box on the Comet screen,What solved the problem for me was going to: "Run"->"Attach Debugger to Android process" and then select your process.,This worked for me, when i tried to use my application without debugging it.

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.

Solution 2

You can fix this issue without re-booting your device. Just go to "Android device"->"Settings"->"Developer Options"->"Select app to be debugged" / "Select debug app". It will likely be pointing to your application. Just select the option and then select "None".

Note: As mentioned, even if "None" is already selected, re-selecting "None" appears to correct the problem.

Note #2: In newer Android devices, the settings location / name might be a bit different. I.e., in my case (Android 11, Samsung) the "None" option is shown as "Nothing" instead.

Just to be clear: This is on the device, not in Android Studio (cf. very helpful comment from Regis_AG).

Solution 3

faster than rebooting is Just go to developer options and switch it off and on again (dont forget to check usb debugging option too), worked for me(Neuxs5).

Solution 4

Please try this command to disable it.

Solution 5

Without restarting the device, I was able to fix this issue by going to «Developer Options» and then first «disabling» and then «enabling»-

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *