如果不调试,为什么 Android Studio 会显示“等待调试器”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20537845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why Android Studio says "Waiting For Debugger" if am NOT debugging?
提问by sensorario
I am working with Android Studio. Since last night, when I Run my project on my device, appear the message "Waiting For Debugger". It is a very strange behavior because I am not debugging application.
我正在使用 Android Studio。从昨晚开始,当我在我的设备上运行我的项目时,出现消息“等待调试器”。这是一个非常奇怪的行为,因为我不是在调试应用程序。
I've tried to uninstall application from my device and press Run on Android Studio. The message appears again.
我试图从我的设备上卸载应用程序,然后在 Android Studio 上按运行。该消息再次出现。
I've tried to restart Android Studio. The message appears again.
我尝试重新启动 Android Studio。该消息再次出现。
The only way to properly install application on my phone is to press "Debug". The message appears but its automatically closed. Then application works fine.
在我的手机上正确安装应用程序的唯一方法是按“调试”。该消息出现但它自动关闭。然后应用程序工作正常。
I've tried with
我试过
<application android:debuggable="false" />
... and still the message appears.
...仍然出现消息。
LogCat says:
LogCat 说:
E/InputDispatcher﹕ channel ~ Channel is unrecoverably broken and will be disposed!
E/Launcher﹕ Error finding setting, default accessibility to not found: accessibility_enabled
Regards on first error line, someone says that the problems can starts after renaming of some resource. But its not my case.
关于第一条错误行,有人说重命名某些资源后问题可能会开始。但这不是我的情况。
Regards on second error line, ... I don't know. I really don't know what happens to my IDE.
关于第二个错误行,......我不知道。我真的不知道我的 IDE 会发生什么。
回答by John Lewin
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.
我过去和今天都遇到过这个问题。在我的情况下,问题是通过设备重启来解决的。干净启动后,我可以再次运行该应用程序,并且不会出现“等待调试器”提示。
回答by CodyF
You can fix this issue without re-booting your device. Just go to "Android device"->"Settings"->"Developer Options"->"Select app to be debugged". It will likely be pointing to your application. Just select the option and then select "None".
您无需重新启动设备即可解决此问题。只需转到“Android设备”->“设置”->“开发者选项”-> “选择要调试的应用程序”。它可能会指向您的应用程序。只需选择该选项,然后选择“无”。
Note: As mentioned, even if "None" is already selected, re-selecting "None" appears to correct the problem.
注意:如前所述,即使已经选择了“无”,重新选择“无”似乎可以更正问题。
Just to be clear: This is on the device, notin Android Studio (cf. very helpful comment from Regis_AG).
需要说明的是:这是在设备上,而不是在 Android Studio 中(参见来自 Regis_AG 的非常有用的评论)。
回答by Robocide
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).
比重新启动更快只需转到开发人员选项并将其关闭并再次打开(不要忘记检查usb调试选项),对我有用(Neuxs5)。
回答by Lou Prado
After 8 hours on this problem I feel obliged to share the cause. My /etc/hosts was bad.
在这个问题上 8 小时后,我觉得有必要分享原因。我的 /etc/hosts 很糟糕。
Make sure you can ping localhost and that it is defined to 127.0.0.1. AS expects to connect to localhost:8600.
确保您可以 ping localhost 并将其定义为 127.0.0.1。AS 希望连接到 localhost:8600。
回答by Raghav Thakkar
1) Clear android studio cache memory from file->Invalid cache/restart.
1)从文件中清除android studio缓存内存->无效缓存/重启。
2) After restarting the android studio please restart android emulator.
2)重启android studio后请重启android模拟器。
回答by Itay Lev
Please try this command to disable it.
请尝试使用此命令禁用它。
adb shell am clear-debug-app
回答by Han
You may want to check your debugging setting in Dev Setting on your AVD. Take a look at the following picture:
您可能需要在 AVD 上的 Dev Setting 中检查您的调试设置。看看下面的图片:
回答by Ajay Taneja
I uninstalled the app with which this issue was occurring.
我卸载了发生此问题的应用程序。
Then I installed the app with debug mode.
然后我以调试模式安装了该应用程序。
It solved the problem. Now it is working fine.
它解决了这个问题。现在它工作正常。
回答by Lucian Novac
I have the same problem. In my case I have two development environments open in the same time: Android Studio and Eclipse. After I close Eclipse and run the debug process again works well. Hope this help!
我也有同样的问题。就我而言,我同时打开了两个开发环境:Android Studio 和 Eclipse。在我关闭 Eclipse 并再次运行调试过程后,运行良好。希望这有帮助!
回答by Oday
I have already solve this problem by reboot my device. It is a device issue not android studio issue.
我已经通过重启我的设备解决了这个问题。这是设备问题而不是 android studio 问题。