Eclipse 调试 Android 不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4617062/
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 Debugging Android doesn't work
提问by Salv0
HI all. I have a problem with Eclipse, debugging an android application: all breakpoints I place doesn't work ( the applications doesn't stop. They are skipped as not placed ). There's a way to make them work?
大家好。我在调试 android 应用程序时遇到了 Eclipse 问题:我放置的所有断点都不起作用(应用程序不会停止。它们因为未放置而被跳过)。有办法让它们工作吗?
I have Win7, JDK 6u23 64bit, Eclipse 3.6 64bit, all breakpoints are enabled ( skip isn't selected ).
我有 Win7、JDK 6u23 64 位、Eclipse 3.6 64 位,所有断点都已启用(未选择跳过)。
Thanks in advance for the answers :)
预先感谢您的回答:)
回答by Erich Douglass
Does the thread list show up in the Debug perspective when you start the app? If not, then Eclipse's debugger is not property attached to the phone/emulator.
启动应用程序时,线程列表是否显示在调试透视图中?如果不是,则 Eclipse 的调试器不是附加到电话/模拟器的属性。
Make sure you have android:debuggable=true
in the Manifest. The latest version of the Eclipse ADT plugin should do this for you, but I've seen a few cases where it didn't work as I expected.
确保您android:debuggable=true
在Manifest 中有。Eclipse ADT 插件的最新版本应该可以为您执行此操作,但我已经看到了一些无法按预期工作的情况。
回答by er0ck
old question, but i've never found my answer anywhere else. Mawg's comment to OP held some clues to my answer.
老问题,但我从未在其他任何地方找到我的答案。Mawg 对 OP 的评论为我的回答提供了一些线索。
for me, "skip all breakpoints" was enabled by default (windows7 64bit, adt pluggin 2.22).
对我来说,“跳过所有断点”是默认启用的(windows7 64 位,adt 插件 2.22)。
i had to go into the Breakpoints tab in the debug perspective to find this. i dont' think it's shown in DDMS. skipping breakpoints is separate from the checkmarks, which, i believe, is the same as "enabling" a breakpoint. i'm not sure why there is a distinction.
我必须进入调试透视图中的断点选项卡才能找到它。我不认为它显示在 DDMS 中。跳过断点与复选标记是分开的,我相信这与“启用”断点相同。我不确定为什么会有区别。
i'd post a pic of a skipped breakpoint but i don't have 10 rep yet. it's the blue circle, but with a "\" through it.
我会发布一张跳过断点的图片,但我还没有 10 代表。它是蓝色圆圈,但中间有一个“\”。
回答by Henk Kleynhans
Restarting Eclipse and my device solved this problem for me.
重新启动 Eclipse 和我的设备为我解决了这个问题。
回答by wkrueger
Solved a similar problem today.
今天解决了一个类似的问题。
Turns out I have disabled an Eclipse option on which the debug window is automatically shown after starting debug (that was annoying to me).
结果我禁用了一个 Eclipse 选项,在启动调试后会自动显示调试窗口(这对我来说很烦人)。
I have to manually focus the Eclipse debug window once in a session (while debugging) in order for the debug buttons (play/pause/etc) to become active. That was automatically done before.
我必须在会话中(在调试时)手动聚焦 Eclipse 调试窗口一次,以便调试按钮(播放/暂停/等)变为活动状态。这是之前自动完成的。
回答by Qing PAN
I use Eclipse Luna with ATD plugin. When I tried to add android:debuggable="true"
in <Application>
of my App's Manifest.xml, I got a compile error Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assigned one.
我使用带有 ATD 插件的 Eclipse Luna。当我尝试添加android:debuggable="true"
在<Application>
我的应用程序的的Manifest.xml的,我得到了一个编译错误Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assigned one.
Finally, I found how to activate breakpoints, I should just press the Debugbutton (the 'bug‘ icon).
最后,我找到了如何激活断点,我应该按下调试按钮(“错误”图标)。