使用 Android 在 Eclipse 中查找堆栈跟踪

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4957730/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:45:30  来源:igfitidea点击:

Finding Stack Trace in Eclipse with Android

javaandroideclipsedebuggingstack-trace

提问by Dave

Not used to using Eclipse for java, mainly used jEdit but with the Android dev along comes Eclipse. I've switched to the debug window and pressed the debug button which starts my app, It crashes however I can't find the stack trace. I can see in the 'Debug' pane that it has crashed with a '' exception however I can't see any more information. Not sure if you can get it but I'm a little used to Visual Studio with line numbers and a bit more information saying what went wrong. As I said all I'm getting is -

不习惯将 Eclipse 用于 java,主要使用 jEdit 但随着 Android 开发者一起来 Eclipse。我已经切换到调试窗口并按下启动我的应用程序的调试按钮,它崩溃了但是我找不到堆栈跟踪。我可以在“调试”窗格中看到它因“异常”而崩溃,但是我看不到更多信息。不确定你是否能得到它,但我有点习惯使用带有行号的 Visual Studio 和一些说明出了什么问题的更多信息。正如我所说的,我得到的只是——

 'Thread [<1> main](Suspended (exception RuntimeException))'

in the debug window. Can anyone shed some light as to where I can find more information?

在调试窗口中。谁能解释一下我在哪里可以找到更多信息?

回答by darioo

For normal Java development in Eclipse, stack traces will appear in console view:

对于 Eclipse 中的正常 Java 开发,堆栈跟踪将出现在控制台视图中:

Window -> Show view -> Console

(if it isn't listed, click on "Other" and find "Console").

(如果未列出,请单击“其他”并找到“控制台”)。

When dealing with Android development, find the "LogCat"view, like I described above. The stack trace should be there.

在处理 Android 开发时,找到"LogCat"视图,就像我上面描述的那样。堆栈跟踪应该在那里。

回答by DKIT

You should read this guide: Debugging Android using Eclipse and ADT

您应该阅读本指南:使用 Eclipse 和 ADT 调试 Android

回答by LordTwaroog

Check out the DDMS perspective and LogCat view. Android logs everything, what can be viewed with LogCat.

查看 DDMS 透视图和 LogCat 视图。Android 记录一切,什么可以用 LogCat 查看。

回答by Paresh Mayani

You can directly type the adb logcatat the command prompt, it will display the stack traces.

您可以adb logcat在命令提示符下直接键入,它将显示堆栈跟踪。

For more info, refer this page: http://developer.android.com/guide/developing/tools/adb.html#logcat

有关更多信息,请参阅此页面:http: //developer.android.com/guide/developing/tools/adb.html#logcat