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.

Let's say I am working with the Android emulator, and get it to run one of my custom images/custom kernels, and it gets stuck in a boot-loop or crashes after a little while in booting up, does it produce a log file that I can look through? And if so, where does it store this "boot" log? (most likely somewhere in the Android build tree)

share|improve this question
    
you could also just do an 'adb logcat' and start your instance to see what happens –  ce4 Jul 25 '12 at 15:18
    
Yeah but it just says <waiting for device>. And if the emulator is simulating the phone crashing, does the emulator itself produce any log messages? –  9exceptionThrower9 Jul 25 '12 at 16:00
    
Well, the emulator itself is just fine. Simulating phone crashes and reboot loops is just as indifferent to it as normal operation –  ce4 Jul 25 '12 at 16:04
    
There are some questions about it on Stackoverflow (google search), it's more dev related though but there are a number of hits. Most probably it has to do something with either permissions for adb or your build is not adb enabled –  ce4 Jul 25 '12 at 16:13

1 Answer 1

kernel panic

When a kernel panic occurs all user space programs are immediately stopped, preventing a user from detecting the cause of the panic: logcat; dmesg and /proc/kmsg will do you no good.

You can still check the /data/dontpanic/ folder for any files present, like:

apanic_console or apanic_threads


kernel boot

Method of logging kernel messages:

  1. invoke "dmesg":

    • See it as it happens:

      # adb shell dmesg
      
    • Direct to a file on your sdcard and see it later

      # adb shell dmesg >/mnt/sdcard/dmesg.txt
      
  2. "tail" the kernel if "syslogd" and /var are available:

    # adb shell cat /proc/kmsg
    
  3. dump the kernel file /proc/kmsg:

    # adb shell cat /proc/kmsg
    

Note: You may need to issue su to gain permissions over some files if you're stuck with an error message. Alternatively, removing shell from the command will execute it on the computer side, not on the phone.


References

share|improve this answer
    
This is great information (as well as the posts you reference). However, it seems there's one massive wall every developer is going to run into: what about a BOOT-LOOP? You're phone (or emulator) crashes as it boots up with your installed image, and keeps trying to reboot, but keeps crashing. How do you get kernel messages or any kind of log to figure out how far the phone gets? –  9exceptionThrower9 Jul 25 '12 at 18:02
    
@9exceptionThrower9 All comes down to the cause! you may check for the folder /data/dontpanic/ for logs concerning the kernel failure or act according to instructions provided by eldarerathis (first link on the references section). –  Zuul Jul 25 '12 at 18:22
    
@9exceptionThrower9 Keep in mind that this type of issues are prone to be very specific, since they depend on many variables. Ain't easy to have a bulletproof solution :) –  Zuul Jul 25 '12 at 18:24

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.