如何在 Eclipse 中停止在 Android 应用程序中进行调试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8301783/
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
How to stop debugging in Android application in Eclipse
提问by Farid Ala
I'm writing a simple Android application. I changed the "Java EE" perspective to "debug" and after tracing variables, I return to original perspective ( "Java EE" ) and stopped debugging. But when I try to run my application on my phone, it changes the perspective automatically to debug and jumps to first break point.
In debug window, it shows:
debugging
我正在编写一个简单的 Android 应用程序。我将“Java EE”视角更改为“调试”,在跟踪变量后,我返回到原始视角(“Java EE”)并停止调试。但是当我尝试在手机上运行我的应用程序时,它会自动更改视角以进行调试并跳转到第一个断点。
在调试窗口,它显示:调试
DalvikVM[localhost:8600]
Thread [<1> main] (Suspended (breakpoint at line 23 in FirstActivity))
FirstActivity.onCreate(Bundle) line: 23
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2627
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679
ActivityThread.access00(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125
ActivityThread$H.handleMessage(Message) line: 2033
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 871
ZygoteInit.main(String[]) line: 629
NativeStart.main(String[]) line: not available [native method]
Thread [<7> Binder Thread #2] (Running)
Thread [<6> Binder Thread #1] (Running)
Would you please help me how get rid of this debug perspective ?
你能帮我如何摆脱这种调试视角吗?
Regards.
问候。
采纳答案by Kevin Coppock
How are you launching the application? If you're using a shortcut, make sure you're doing Run As... Android Applicationrather than Debug As... Android Application. I'm out of practice, but I believe the shortcut for Run Asin Eclipse is Ctrl+F11?
你如何启动应用程序?如果您使用的是快捷方式,请确保您正在执行Run As... Android Application而不是Debug As... Android Application. 我没有练习,但我相信Run AsEclipse 中的快捷方式是 Ctrl+F11?
回答by jmcdale
Suggestions:
建议:
- When you right click the project, make sure you select 'Run as' rather than 'Debug as'
- While in the debug perspective, click the icon to disconnect the debugger (In my eclipse, it's the icon to the right of the Stop icon)
- Disable all breakpoints
- 右键单击项目时,请确保选择“运行方式”而不是“调试方式”
- 在调试视图中,单击图标以断开调试器的连接(在我的 eclipse 中,它是停止图标右侧的图标)
- 禁用所有断点
回答by Pedantic
Remove or disable the breakpoint on FirstActivity.onCreate(Bundle) line: 23
删除或禁用断点 FirstActivity.onCreate(Bundle) line: 23
Alternatively, restart your app using a Run Configuration from the Eclipse menu instead of a Debug config.
或者,使用 Eclipse 菜单中的运行配置而不是调试配置重新启动您的应用程序。
回答by Nirav Zaveri
I kept getting the debug perspective despite all the having configured all the settings that were posted above.
尽管已经配置了上面发布的所有设置,但我一直在获得调试视角。
I found an answer on another StackOverflow: Reboot your debugging device.
我在另一个 StackOverflow 上找到了答案:重新启动调试设备。
(Don't power off, instead choose Reboot). That worked for me.
(不要关闭电源,而是选择重新启动)。那对我有用。

