Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

After being annoyed with my previous ROM, I thought I'd install ICS on my SGS2 (until CM9 comes out). But, sadly, it now reboots several times a day without any real reason. The device is just lying there on the table doing nothing and every now and then the screen turns on and I can watch it reboot.

So, how would I start to analyse this issue? Obviously I could try to flash different ROMs like a mad man until the issue resolves itself, but I would prefer a more sensible approach.

share|improve this question

5 Answers 5

up vote 3 down vote accepted

You can install the android SDK and use DDMS to monitor the logcat. The thing with a logcat, it is cleared when the device reboots, but you may be able to get an idea of what is crashing if you are monitoring it before it reboots.

You can probably also find unofficial CM9 nightlies for the Galaxy S2, but I am not sure what issues still exist for that device.

share|improve this answer
    
To my knowledge, these are the current CM9 alpha issues: teamhacksung.org/wiki/index.php/… –  Oliver Salzburg Jan 30 '12 at 14:56

I had a similar random-rebooting problem, and after one such reboot, I hooked up the phone to my laptop and ran "adb bugreport" on it. I got what looked like useful information, and attached it to the bug. So I think at least some log information survives a reboot.

Here's the bug, btw: http://code.google.com/p/android/issues/detail?id=24118

share|improve this answer
    
Oh wow, that generates a TON of output. I'll run it again after the next reboot and see what it spits out. –  Oliver Salzburg Jan 30 '12 at 19:07
    
I've been going crazy trying to figure out a random reboot on one of my test phones. I'm not the OP, but this is extremely helpful, thanks for posting it! –  amy Feb 5 '12 at 9:22

The first thing I would try to do is to retrieve the logs of the errors via ADB, and/or crash dumps.

Retrieving the logs is tricky, since the log cache gets erased on reboot. If the phone reboots even while sitting on a charger, try running adb logcat continuously (you will need Android SDK and USB drivers installed and configured on your PC.) When the phone reboots, look at the last several pages in the command prompt window for any errors or abnormalities.

If you can't reproduce the reboots while the phone is hooked up to USB, I suggest installing an app like aLogcat, and setting it up to write logs to the SD Card on an interval. Hopefully you will get lucky and catch the errors that way.

You can also try pulling out the crash dumps via the following commands:

su  
cat /proc/last_kmsg > /mnt/sdcard/last_kmsg

This should create a file named "last_kmsg" on your SD Card that contains last few debugging messages from the kernel. Open it with any text editor and see if anything obvious shows up.

share|improve this answer
    
Either I'm using the ADB shell incorrectly or /proc/last_kmsg is non-existent on my phone. –  Oliver Salzburg Jan 30 '12 at 15:59

You can try aLogrec, and if you like it, the donate version. Written by the same programmer that wrote aLogcat, it continuously records the log (logcat) to your SD card. I haven't tested it for how it reacts with restart from a crash, but I tested with a manual restart and the recorded log survived the restart and could see the shutdown sequence being logged. One downside is the log does not include timestamps.

My T-mobile S II had been crashing (restarting) when using basic features - ending a call (once), taking a picture (once) or using navigation (3 times). I upgraded from ICS 4.0.3 to 4.0.4. So far it has been good. I wish I had known about aLogrec while I was having these restarts.

share|improve this answer
    
supposedly doesn't work in 4.x according to the reviews –  endolith Oct 20 at 16:57
    
Logcat Extreme works in 4.x though. play.google.com/store/apps/details?id=scd.lcex&hl=en –  endolith Oct 21 at 15:23

I had the same problem but in the few minutes it gave me each time I experimented and found that it stopped crashing if I went to the network update in the settings, even though there is no update available. It now works but I'd annoying needing to do that every time.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.