Eclipse android 项目总是在调试中启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4342588/
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
Eclipse android project always lauching in debug
提问by Jason Rogers
I feel silly asking this and even more silly to have this problem. I have a android project that has been executing fine until now.
我觉得问这个很傻,遇到这个问题更傻。我有一个 android 项目,到目前为止一直运行良好。
but a couple of days ago, without me doing anything particular that I know of, my project has been always launching itself in debug no matter what I try (clicking on the debug or run gives me the same result). I try looking in the project settings and the build configuration but can't see anything justifying this.
但是几天前,没有我做任何我知道的特别的事情,无论我尝试什么,我的项目总是在调试中启动自己(单击调试或运行会给我相同的结果)。我尝试查看项目设置和构建配置,但看不到任何理由。
so right now each time I launch the app I have to go to go to debug tab and click on disconnect...
所以现在每次启动应用程序时,我都必须转到调试选项卡并单击断开连接...
Any ideas
有任何想法吗
采纳答案by Jason Plank
Have you checked your run configurations menu? You might have some extraneous configurations in there that Eclipse is defaulting to when you choose to launch the project.
您是否检查过运行配置菜单?当您选择启动项目时,您可能有一些无关的配置,Eclipse 默认使用这些配置。
Failing that, there is an option called "Launch in debug mode whenever the workspace contains breakpoints" in the Run/Debug -> Launching preference page. You might want to check to make sure that this option is not enabled.
如果失败,在运行/调试 -> 启动首选项页面中有一个名为“每当工作区包含断点时启动调试模式”的选项。您可能需要检查以确保未启用此选项。
As a last resort when facing these kinds of quirks I will sometimes create a new project and copy over my source files (provided the project is not very large). Closing and re-launching Eclipse sometimes works wonders for me as well.
作为面对这些怪癖的最后手段,我有时会创建一个新项目并复制我的源文件(假设项目不是很大)。关闭并重新启动 Eclipse 有时对我也有奇效。
回答by Brian Wigginton
Restart the device
重启设备
I was experiencing the same problem where my app was always being run in debug mode. Restarting the device did the trick for me.
我遇到了同样的问题,我的应用程序总是在调试模式下运行。重新启动设备对我有用。
回答by Kennifer
As said above, the problem is with the device not eclipse.
如上所述,问题在于设备不是eclipse。
Restarting the device will work, but also killing the application thread/process in the DDMS will do the same job.
重新启动设备会起作用,但杀死 DDMS 中的应用程序线程/进程也会做同样的工作。
回答by Pēteris Caune
On the emulator, go to App Drawer, launch application "Dev Tools". Inside there, pick "Development Settings". Make sure that the field "Debug App" has value "(none)".
在模拟器上,转到 App Drawer,启动应用程序“Dev Tools”。在那里,选择“开发设置”。确保字段“调试应用程序”具有值“(无)”。
回答by ezamur
Ok, I know I am a bit late with this one but I found a solution. It might be not acceptable for someone, but than again, it solved the problem. I just reset my phone to factory settings. After that I was able to install the app without getting "waiting debugger to attach" message always.
好的,我知道我对这个有点晚了,但我找到了一个解决方案。对于某些人来说,这可能是不可接受的,但它再次解决了问题。我只是将手机重置为出厂设置。在那之后,我能够安装该应用程序而不会总是收到“等待调试器附加”消息。
回答by gabrjela
I ran into the same problem these days, but none of the solutions above worked for me(except for factory reset, don't wanna do that for now).
这些天我遇到了同样的问题,但上面的解决方案都不适合我(除了恢复出厂设置,现在不想这样做)。
As Kennifer stated, problem is with the device since this happens only on my Zync Z5 phone (I have several other devices with Android on which app start in Run mode, not Debug mode).
正如 Kennifer 所说,问题出在设备上,因为这仅发生在我的 Zync Z5 手机上(我还有其他几款带有 Android 的设备,这些设备上的应用程序以运行模式启动,而不是调试模式)。
The only trick that worked for me was to delete the launch configuration every time wanted to run app after a debug, but it's annoying to do this every time I need a debug.
唯一对我有用的技巧是每次在调试后想要运行应用程序时删除启动配置,但是每次我需要调试时都这样做很烦人。
回答by John
I'd tried everythingon here and was surprised by the overwhelming acceptance of the top answer
我已经尝试了这里的所有内容,并且对最佳答案的压倒性接受感到惊讶
Restart the device
重启设备
then I realised, "this is a development phone, stop treating it like a business's server", and proceeded to restart.
然后我意识到,“这是一款开发手机,不要把它当作企业的服务器”,然后重新启动。
Worth risking an answer to endorse this solution as a last resort.
值得冒险回答以支持此解决方案作为最后的手段。
My outcome- the app quickly, but quietly died. Result ! :(
我的结果 - 应用程序很快,但悄悄地死了。结果 !:(
回答by Rabamirezzan
My Eclipse version: Luna.
我的 Eclipse 版本:Luna。
My case: The option Launch in debug mode when workspace contains breakpointsis Never, but eclipse launches in debug mode.
我的情况:当工作区包含断点时,在调试模式下启动的选项是Never,但 eclipse 在调试模式下启动。
My Solution:
我的解决方案:
- Go to Window->Preferences->Run/Debug->Launching.
- Mark Promptin option Launch in debug mode when workspace contains breakpoints.
- Launch.
- A dialog will popup: There are breakpoints enabled in the workspace. Would you rather launch in debug mode?
- Check Remember my decision, then press Nobutton, and problem resolved.
- 转到窗口-> 首选项-> 运行/调试-> 启动。
- 当工作区包含断点时,在调试模式下启动选项中标记提示。
- 发射。
- 将弹出一个对话框:工作区中启用了断点。您更愿意在调试模式下启动吗?
- 检查记住我的决定,然后按否按钮,问题解决。