stealthcopter
stealthcopter

Reputation: 14176

Android: Retrieve logcat before crash (reboot) on a real device

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.

Upvotes: 7

Views: 10383

Answers (6)

Dan
Dan

Reputation: 580

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

Upvotes: 0

fivef
fivef

Reputation: 2557

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

Upvotes: 2

John Eldredge
John Eldredge

Reputation: 11

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

Upvotes: 0

likejudo
likejudo

Reputation: 3716

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.

Upvotes: 2

Mathias Conradt
Mathias Conradt

Reputation: 28665

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.

Upvotes: 3

Sephy
Sephy

Reputation: 50392

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

Upvotes: -1

Related Questions