How to locate app crash logs in Android phone?

夙愿已清 提交于 2019-12-23 07:11:09

问题


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

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


回答1:


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

    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.




回答2:


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



来源:https://stackoverflow.com/questions/24407984/how-to-locate-app-crash-logs-in-android-phone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!