Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get logcat logs after phone reboots?

I'm testing an android application with a long running service. I'm using Eclipse and have the usb cord hooked up with the phone sitting next to me. Since it's a long ongoing service, I do some other work while it runs and check the logcat logs every once in a while to make sure everything is going as expected.

A few minutes ago I noticed the phone rebooting. I think it's done this before as it would explain some weird application behavior. I quickly switched over to Eclipse to see what happened and found that the logcat log was (it seems) cleared during the reboot. So there's no log of whether my app crashed (and took down the phone?!) or if there was some other problem that took down the phone and my app.

Is there anyway I can find out what happened? This is a development phone, so I don't know if it reboots/crashes often on its own, or only while my app is running. It's a Motorola Droid running Firmware version 2.1-update1.

Thanks for your help.

like image 687
Scott Saunders Avatar asked Aug 12 '10 14:08

Scott Saunders


2 Answers

I don't know of any way to do this. However, you could start up logcat in adb with adb logcat -v time > logcat.txt and then run your app again. If it crashes a second time, then you can go look at the output in logcat.txt on your machine.

like image 195
eldarerathis Avatar answered Oct 20 '22 15:10

eldarerathis


You can use adb bugreport, which should contain some information regarding a spurious reboot - for example, a kernel panic, last logcat entries etc.

Be warned, though: this tool outputs immense amounts of information, so you'll have to dig deep to find what you need.

like image 43
adamk Avatar answered Oct 20 '22 15:10

adamk