How to log hard finding crash in Android?

こ雲淡風輕ζ 提交于 2020-01-24 15:48:08

问题


I've an app which crash almost once a day, and I've used the default uncaught exception handler in order to save the crash log

e.g.

Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler("/sdcard/crash"));

However, for normal crash such as stackoverflow (intentional) it can be logged, but for my bug it never get logged. I guess it is because the crash is raised outside the scope of a normal activity. (yes, the crash happen when the app is in the background)

I've also tried to connect the device to my computer and log the logcat out via adb logcat > log.txt, however, the adb will timeout for a while (adb device return not connected until I re-plug it again) and the logging will stop.

So, are there any other way I can use to log and identify my bug?

Update: For those suggesting other remote logging tools, I want to say that I've already using setDefaultUncaughtExceptionHandler to save the exception to a local file, are there any exception that the tools can help but not my current method? I use for debug only, not for production


回答1:


There are a few other Crash Reporting libraries out there...

https://try.crashlytics.com/

http://hockeyapp.net/features/crashreports/

https://github.com/ACRA/acra

Just to name a few...




回答2:


Yes My brother !

You can use CrashAnalytics

Just go on this link https://crashlytics.com and put you mail id for verification and after getting approval mail you can register with your email id and use these service and you will able to get all the crashes and device information too .For Approval it will take time for one to two days

I hope this will help you.

It is permanent solution to get the crash log.You can also get the crash log after uploading the build on google play and you can assign more than one email to get the crash log for reference.



来源:https://stackoverflow.com/questions/27415434/how-to-log-hard-finding-crash-in-android

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