如何在 Android 手机中找到应用程序崩溃日志?

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

How to locate app crash logs in Android phone?

androidcrash

提问by user249605

If any Android app crashes some crash logs are generated on behalf of that app. How to find the location of such crash logs.

如果任何 Android 应用程序崩溃,则会代表该应用程序生成一些崩溃日志。如何找到此类崩溃日志的位置。

I want crash logs inside the Android device, not really using Logcat to see the crash logs.

我想要 Android 设备中的崩溃日志,而不是真正使用 Logcat 来查看崩溃日志。

回答by Sekhar Madhiyazhagan

In logcat stack trace, you can find exception/error details. Say for an example,

在 logcat 堆栈跟踪中,您可以找到异常/错误详细信息。举个例子,

    04-23 08:00:07.524: E/AndroidRuntime(1384): Caused by: java.lang.NullPointerException
    04-23 08:00:07.524: E/AndroidRuntime(1384):     at com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onCreate(SimpleAndroidOCRActivity.java:68)
    04-23 08:00:07.524: E/AndroidRuntime(1384):     at android.app.Activity.performCreate(Activity.java:5104)
    04-23 08:00:07.524: E/AndroidRuntime(1384):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    04-23 08:00:07.524: E/AndroidRuntime(1384):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

here java.lang.NullPointerException thrown exception if you click com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onCreate(SimpleAndroidOCRActivity.java:68) You can get where which throws null pointer exception in program.

这里 java.lang.NullPointerException 抛出异常如果你点击 com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onCreate(SimpleAndroidOCRActivity.java:68) 你可以得到程序中抛出空指针异常的地方。

回答by scrayne

You can use ACRA to see the stack trace when an app crashes on a device. It's a library and you can call its API wherever you want in your program. There are several choices for where to send the information, among them an email address. Here are the instructions for setting it up: https://github.com/ACRA/acra/wiki/BasicSetup

当应用程序在设备上崩溃时,您可以使用 ACRA 查看堆栈跟踪。它是一个库,您可以在程序中的任何位置调用其 API。发送信息的位置有多种选择,其中包括电子邮件地址。以下是设置说明:https: //github.com/ACRA/acra/wiki/BasicSetup