Android: Retrieve logcat before crash (reboot) on

2019-02-17 15:00发布

I am developing an application and during my testing on a real device I have found that it will crash and cause the phone to reboot (worrying I know...)

Is there any way I retrieve the logcat from before the phone rebooted as the logcat seems to reset when the phone boots up.

Thanks in advance.

6条回答
Juvenile、少年°
2楼-- · 2019-02-17 15:26

Use http://code.google.com/p/acra/, which is a great lib to send crash reports to a google form incl. stack trace. I use it in my app and works nicely. Let me know if you have any difficulties implementing it. Read the http://code.google.com/p/acra/wiki/ACRAHowTo, it's easy to setup.

查看更多
Animai°情兽
3楼-- · 2019-02-17 15:27

From slashfoo's blog, (check the logcat page for exact syntax) hook up your computer to start off the logcat process in the background. adb shell nohup logcat -f /dev/[your sdcard] -n60 -r3600

Although it means logcat will be saved to the sdcard but every time you reboot, you must perform the procedure again.

查看更多
时光不老,我们不散
4楼-- · 2019-02-17 15:31

Updating for 2019, Fabric, which was purchased by Google, does an excellent job of remote logging app crashes. Integration into the app was simple, and it is free (at least at whatever level I'm using it). It has been extremely valuable to finding defects in my apps.

https://www.fabric.io

查看更多
虎瘦雄心在
5楼-- · 2019-02-17 15:33

Use the alogrec program. It writes the log to the SD card, and will automatically resume after rebooting.

查看更多
相关推荐>>
6楼-- · 2019-02-17 15:36

Easiest way: Get aLogrec from Market for free. This app saves the logs to sdcard.

查看更多
混吃等死
7楼-- · 2019-02-17 15:41

Try to open a terminal/command prompt and issue this in it :
adb -d logcat
This should dump you a live version of the logcat you could read to find the problem

查看更多
登录 后发表回答