如何解决“等待调试器”问题信息?

发布于 2024-10-06 02:27:11 字数 1128 浏览 8 评论 0原文

我使用 SDK 2.2 将 HTC Comet 连接到 Eclipse。我进行了调试构建 - 应用程序不运行;尽管它确实安装在设备上。在设备上,我在 Comet 屏幕上收到此消息框

等待调试器
应用程序 HunyDew(进程 com.airvine.hunydew)正在等待调试器附加。
[强制关闭]

而在 Eclipse 控制台中,我收到了这些消息

[2010-12-07 01:42:29 - hunydewprj] Android Launch!  
[2010-12-07 01:42:29 - hunydewprj] adb is running normally.  
[2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch  
[2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall.  
[2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC  
[2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere }  
[2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601  
[2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out.  

应用程序在模拟器中运行良好 - 请帮助 - 我在这里缺少什么?有任何提示/建议吗?谢谢

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

Waiting for Debugger
Application HunyDew (process com.airvine.hunydew) is waiting for the debugger to attach.
[Force Close]

Whereas in the Eclipse console I get these set of messages

[2010-12-07 01:42:29 - hunydewprj] Android Launch!  
[2010-12-07 01:42:29 - hunydewprj] adb is running normally.  
[2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch  
[2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall.  
[2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC  
[2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere }  
[2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601  
[2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out.  

The application runs fine in the Emulator - please help - what is it that I am missing here? Any hints/suggestions? Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

赠意 2024-10-13 02:27:12

对于那些在 4.2.2 中遇到这种烦人行为的人,您必须在开发人员选项中取消选中“等待调试器”设置。当然,这些选项被谷歌隐藏了,你必须采取一些偷偷摸摸的技巧才能让它们重新显示出来。我在它们消失之前就已经把它们设置好了,但我却再也找不到它们了。

此页面解释了该过程

For those getting this annoying behavior in 4.2.2 you have to un-check the setting for "wait for debugger" in the developer options. Of course, those options were hidden by Google, and you have to do a sneaky trick to get them to show back up. I had set them before they disappeared, and couldn't for the life of me find them again.

This page explains the procedure

万水千山粽是情ミ 2024-10-13 02:27:12

运行 Android Studio 时,我遇到了这个问题,在尝试了各种补救措施后,重新启动 Android Studio 似乎可以解决该问题。

Running Android Studio, I ran into this problem and after trying various remedies restarting Android Studio is what appeared to fix the problem.

記柔刀 2024-10-13 02:27:12

我的解决方案是使用 Dalvik 调试监视器。有时进程旁边会出现红色或绿色的错误。单击您要加载的设备。选择“操作”选项卡并重置 adb。这通常会为我附加调试器。我发现通过此 Monitor 进行调试比使用 Android Eclipse 插件 Logcat 更适合我。

My solution is to use the Dalvik Debug Monitor. Sometimes there is a red or green bug beside a process. Click on the device you're trying to load to. Select the Actions tab and reset adb. This usually attaches the debugger for me. I find that doing debugging through this Monitor works better for me than using the Android Eclipse plugin Logcat.

樱娆 2024-10-13 02:27:12

关闭模拟器并关闭 eclipse。重新打开 Eclipse 并启动模拟器对我有用。

要查找的关键内容是在 Eclipse 的“设备”窗格中。如果您启动模拟器或设备,它显示在设备名称列表中,但显示 [null],并且其下方没有显示正在运行的进程,那么它将无法正常加载您的应用程序。

如果设备名称出现并且处于在线状态,那么事情似乎进展顺利。

但不知道为什么它总是不起作用。

Closing the emulator and closing eclipse. Reopening Eclipse and starting the simulator worked for me.

The key thing to look for is in the Devices pane of Eclipse. If you start the emulator or device and it shows up in the device name list but says [null] and no running processes show beneath it, then it won't work correctly with loading your app into it.

If the name of the device comes up and is Online then things seem to work smoothly.

Don't know why it doesn't work out all the time though.

牵你的手,一向走下去 2024-10-13 02:27:12

就我而言,问题是由 adb 连接到另一个设备引起的。

如果PC上连接了多台设备,请删除除所需设备之外的其他设备。

In my case, the problem is caused by adb connected with another device.

If several devices are connected in PC, remove other devices except required one.

凝望流年 2024-10-13 02:27:12

我最终进入“调试”视角。

然后在“调试”框中,有调试列表或运行列表。

您必须确定您当前的哪一个存在此问题(等待
用于调试...)

然后右键单击并选择“终止并删除”。

然后你再次尝试跑步。那个警告框将会消失。

I end up going into "Debug" perspective.

Then in the "Debug" frame, there are debug list or running list.

You have to decide which one is your current one that has this problem (Waiting
for debug...)

Then do right-click and choose "Terminate and Remove".

Then you try to run again. And that warning box will be gone.

残龙傲雪 2024-10-13 02:27:12

我这样解决了这个问题:

转到运行菜单====>点击编辑配置 ====> 杂项,最后取消选中选项如果 APK 未更改则跳过安装

在此处输入图像描述

在此处输入图像描述

I solved this issue this way:

Go to Run menu ====> click on Edit Configurations ====> Micellaneous and finaly uncheck the option Skip installation if APK has not changed

enter image description here

enter image description here

不乱于心 2024-10-13 02:27:12

重新启动手机是我的解决方案。

Rebooting the phone was the solution for me.

爱冒险 2024-10-13 02:27:12

如果您的开发环境是 Windows,请确保 USB 驱动程序已正确安装。

确保正确安装 USB 驱动程序的一种方法是获取 PDANet Windows 安装程序并让它安装 USB 驱动程序。

您可以在此处找到 PDANet 页面。

If your development environment is Windows make sure the USB drivers are correctly installed.

One way to ensure that the USB drivers are installed correctly is to get the PDANet Windows installer and let it install the USB drivers.

You can find the PDANet page here.

失眠症患者 2024-10-13 02:27:12

我会尝试在没有 Eclipse 的情况下自行使用 ddms 连接到手机。您可能在 Eclipse 中运行一个您看不到的模拟器,或者在 Eclipse 中遇到一些其他问题。

只需从命令提示符运行 ddms 并查看设备是否出现并且您可以连接到它。

您还可以查看运行 adb devices 时是否出现,并查看您的手机已列出(可能还有其他内容......)

I would try to connect to the phone with ddms on its own without Eclipse. You might be running an emulator inside eclipse that you dont see or have some other problems with Eclipse.

Just run ddms from a command prompt and see if the device appears and you can connect to it.

You can also see if appears when you run adb devices and see that your phone is listed (and maybve something else..)

绮筵 2024-10-13 02:27:12

我遇到了同样的问题,我知道我没有运行任何其他实例,并且我可以使用 adb devices 看到它。我刚刚重新启动了 eclipse 并且它起作用了。

I got the same problem, I know I wasn't running any other instances, and I could see it with adb devices. I just did a restart of eclipse and it worked.

热鲨 2024-10-13 02:27:12

重新启动电脑是唯一对我有用的事情。当我在使用 Android 2.2 手机和 Android 3.1 平板电脑时遇到此问题时,它起作用了。

Rebooting the PC was the only thing that worked for me. It worked when I had this problem with an Android 2.2 phone, and also an Android 3.1 tablet.

江挽川 2024-10-13 02:27:12

我今天遇到了这个问题。在花了一天的大部分时间尝试修复它之后,唯一有效的方法是创建一个新的工作区并将我的项目导入其中。我希望这可以帮助某人避免我经历的所有麻烦。

I ran into this problem today. After spending most of the day trying to fix it, the only thing that ended up working was to create a new workspace and import my project into it. I hope this helps someone avoid all the trouble that I went through.

奈何桥上唱咆哮 2024-10-13 02:27:12

我也遇到这个问题。在我的环境中,我使用 tomcat 作为服务器,使用 android 作为客户端。我发现,
如果启动 tomcat,会出现此错误“启动错误:无法连接到远程 VM。连接超时。”会发生。
如果tomcat没有运行,adb可以正常工作。

I also enounter this problem. In my environment, I use a tomcat as server and android as client. I found,
If tomcat is started, this error " Launch error: Failed to connect to remote VM. Connection timed out." will occur.
If tomcat is not run, adb works well.

你在我安 2024-10-13 02:27:12

我尝试了上面的所有解决方案,有时它可以解决问题,但仍然时不时地遇到“等待调试器附加”消息框。

我的情况的最终解决方案是拔掉除我想要调试的设备之外的所有 Android 设备。我不知道哪一个是罪魁祸首:运行 JB 4.2 的 Nexus 7、运行 ICS 的 HTC One X、运行 Gingerbread 的 HTC Desire S 或 3 者的组合,但只要我只插入一个设备,运行如丝般顺滑。

I tried all the solutions above, it fixes the issue sometimes, but still from time to time I happened to get stuck with the "Waiting for the debugger to attach" message box.

The final solution in my case was to unplug all the Android devices but the one I want to debug on. I don't know which one is the culprit: the Nexus 7 running JB 4.2, the HTC One X running ICS, the HTC Desire S running Gingerbread, or the combintation of the 3, but as soon as I only have one device plugged in, it runs smooth as silk.

焚却相思 2024-10-13 02:27:12

我使用任务管理器杀死adb.exe来解决这个问题。 Adb.exe被杀死后会自动启动。

到目前为止,杀死 adb.exe 已经为我解决了很多与调试和模拟器相关的问题。

I used Task Manager to kill adb.exe to solve this problem. Adb.exe will automatically start after being killed.

Killing adb.exe has solved a lot of problems related to debug and emulators for me so far.

花心好男孩 2024-10-13 02:27:12

对于 Android Studio 用户,我在尝试运行裸机时第一次遇到此问题
更新我的jdk位置后不久的bone项目。所以我偶然发现了这篇文章。就我而言,简单的构建->清理项目就完成了这项工作。

For Android Studio users I encountered this problem first time while trying to run a bare
bone project just after updating my jdk location. So I stumbled across this post. In my case simple Build->Clean Project did the job.

甜宝宝 2024-10-13 02:27:12

我在使用 Android Studio 和 GenyMotion 时也遇到了同样的问题。
我可以通过暂停程序并在显示“等待调试器”消息后再次恢复程序来解决此问题。它也可以在使用其他 IDE 和模拟器时工作。在此处输入图像描述

I was also having the same problem when using Android Studio and GenyMotion.
I am able to solve this problem by pausing the program and resuming it again after "Waiting for debugger" message is shown. It may work while using other IDEs and emulators as well.enter image description here

薄荷→糖丶微凉 2024-10-13 02:27:12

Mac OS 10.10 上的 Android Studio 1.2.2
与其他人报告的问题相同。
我关闭了 Android Studio,然后从终端中的命令行进行检查:

ps -efw|grep -i android

这报告了与 Android Studio 关联的 java 进程(.gradle/daemon)。我杀掉了这个进程,重新启动 Android Studio,问题就消失了。

Android Studio 1.2.2 on Mac OS 10.10
Same problem as others have reported.
I closed Android Studio, then checked from command line in terminal:

ps -efw|grep -i android

This reported a java process (.gradle/daemon) associated with Android Studio. I killed this process, restarted Android Studio, and the problem went away.

苏别ゝ 2024-10-13 02:27:12

禁用手机中的开发者选项。

设置>开发者选项>禁用

当我尝试使用我的应用程序而不调试它时,这对我有用。

disable you developer option in your phone.

Settings > Developer option > Disable

This worked for me, when i tried to use my application without debugging it.

惜醉颜 2024-10-13 02:27:12

为我解决问题的方法是:
“运行”->“将调试器附加到 Android 进程”,然后选择您的进程。

您可以在 Android Studio 中执行此操作。

What solved the problem for me was going to:
"Run"->"Attach Debugger to Android process" and then select your process.

You do this in Android Studio.

喜爱纠缠 2024-10-13 02:27:12

我遇到了同样的问题,通过在调试配置中明确选择所需的设备来修复它。不幸的是,即使在调试器尝试连接时该日志有时也会停止。在这种情况下,在 DDMS 视角中找到所需的流程。它将以绿色小虫突出显示。单击停止,然后再次调试。

I had the same issue, fixed it by explicitly selecting desired device in debug configuration. Unfortunately, even after that log sometimes stops when debugger tries to connect. In this case in DDMS perspective find the desired process. It will be highlighted with green bug. Click stop and then debug it again.

爱的十字路口 2024-10-13 02:27:12

这可能是旧的,但对于 Genymotion 的最新更新 2.7.1,请转到开发者选项,如果您不知道如何打开该选项,请转到关于手机并单击内部版本号几次,开发者选项将启用。 打开开发者选项,勾选USB调试

在 Genymotion 4.4 及更高版本上测试。
奇怪的解决方案是吧?但绝对有效。希望有帮助。
快乐的编码。

This may be old, but for Genymotion's latest update 2.7.1, go to Developer options, if in case you dont know how to open that option, go to About phone and click Build number few times and Developer options will be enabled. Turn ON Developer option, check USB debugging.

Tested on Genymotion 4.4 and up.
Weird solution eh ? But definitely works. Hope it helps.
Happy codings.

绝影如岚 2024-10-13 02:27:12

在调试模式下,Android Studio 通过套接字(:8600)连接到您的设备。不知何故,您的套接字连接被阻塞,因此无法响应传入的连接。

重启Android Studio,问题就解决了

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

游魂 2024-10-13 02:27:12

开发者选项中的“等待调试器”可能已设置为等待您的应用程序。请清除该选项,应用程序应该正常运行。

"Wait for debugger"in Developer options may have been set to wait your application.Please clear that option and application should run normally.

兮颜 2024-10-13 02:27:11

如果应用程序在其清单文件中设置了 android.permission.SET_DEBUG_APP 权限,某些设备只会允许调试器附加:

<manifest>
  <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
</manifest> 

Some devices will only let the debugger attach if the application has the android.permission.SET_DEBUG_APP permission set in its manifest file:

<manifest>
  <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
</manifest> 
灯角 2024-10-13 02:27:11

如果您正在构建调试应用程序或在源代码中的某个位置调用了 Debug.waitingForDebugger();,则会显示“等待调试器”对话框。

在 Android Studio 2.0 及更高版本中,有一个将调试器附加到 Android 进程的选项。它是“运行”菜单中的最后一个菜单项。

Android 中运行菜单选项的屏幕截图工作室

The Dialog Waiting for Debugger is shown if you are building a debug application or somewhere in your source code, you called Debug.waitingForDebugger();

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.

Screen shot of Run menu options in Android Studio

如何视而不见 2024-10-13 02:27:11

不确定这是否是您正在寻找的内容,但请尝试将:

android:debuggable="true"

放在 AndroidManifest.xml 的应用程序标记中

Not sure if this is what you are looking for, but try putting:

android:debuggable="true"

in the application tag in the AndroidManifest.xml

北方的韩爷 2024-10-13 02:27:11

我长期以来一直遇到这个问题,当控制台和模拟器都显示等待连接到调试器时,我无法让我的 Android 模拟器或设备连接到调试器。

而且eclipse内部的调试配置以前也让我很困惑,但是今天,我通过以下步骤解决了这个问题:

当你想调试一个android项目时,例如mypro。您可以在“Package Explorer”中右键单击它。然后选择“调试为”-->“Android 应用程序”。

然后模拟器可能会停止在“等待连接到调试器”(或类似的其他内容)。

然后,您需要自己连接到调试器,方法是单击“DDMS”打开 DDMS 透视图,然后单击“设备”选项卡。

然后您可以看到模拟器或设备上正在运行的进程列表。

双击您正在调试的程序,然后切换到“调试”视角,您可以看到调试器已连接,您可以调试您的程序。这就是我解决这个问题的方法。

顺便说一句,我的操作系统是Win7 32位。 Eclipse 的版本是Helios Service Release 2。Android SDK 是rev。 16和platform-tools'10.

更新。

我发现这是我的TCP/IP配置的问题。当我分配静态 IP 地址(用于访问互联网)时,调试器无法连接。

因此,每次当调试器无法连接时,我总是执行以下步骤:

1.关闭当前的 eclipse 窗口。

2.将IP地址配置更改为动态,这意味着通过DHCP获取IP地址。

3.再次打开eclipse。

然后就可以连接调试器了。我认为这可能是使用套接字连接的java调试器的内部机制的问题。

I've got this problem for long that I cant get my android emulator or device connect to the debugger while both the console and the emulator were displaying waiting for connecting to the debugger.

And configuration for debug inside eclipse also confused me so much before, but today, i got this problem solved, by the following steps:

When you want to debug a android project, for instance, mypro. you would right click on it in the "Package Explorer". Then choose "Debug as"-->"Android Application".

Then the emulator might stop at the "Waiting for connecting to debugger"(or something else similar to this).

Then you need to connect to the debugger yourself by click "DDMS" to open the DDMS perspective, and click "Devices" tab.

Then you can see a list of processes that are running on your emulator or device.

Double click on the one which you are debugging, then change to the Debug perspective, you can see the debugger is connected and you could debug your program. That's how I solved this problem.

By the way, my OS is Win7 32-bit. Eclipse's version is Helios Service Release 2. Android SDK is rev. 16 and platform-tools' 10.

Update.

I found that it is the problem of my TCP/IP configuration. The debugger can't be connected when i assign a static IP address(for access to internet).

So every time when the debugger is unable to connect, I always do the following steps:

1.close current eclipse window.

2.change the config of IP address to dynamic, it means getting a IP address by DHCP.

3.open up the eclipse again.

then the debugger is able to be connected. I thought it might be a issue of the internal mechanism of java debugger which is using socket connection.

趁年轻赶紧闹 2024-10-13 02:27:11

如果我将 USB 电缆切换到 PC 上的不同端口,就会出现此情况,这很奇怪,但当我再次切换回来时它会工作。另外,我认为当另一个设备或模拟器同时运行,或者两个 Eclipse 实例打开时,我就会遇到这种情况。

I get this if I switch the usb cable to a difference port on my PC, odd but it works when I switch it back again. Also I think I've got this when there's been another device or emulator running at the same time, or two instances of Eclipse open.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文