Does the Android emulator generate some sort of log file I can access if it crashes? 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)
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:


invoke "dmesg":


See it as it happens:

# adb shell dmesg

Direct to a file on your sdcard and see it later

# adb shell dmesg &gt;/mnt/sdcard/dmesg.txt


"tail" the kernel if "syslogd" and /var are available:

# adb shell cat /proc/kmsg

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


Stackoverflow answer from eldarerathis to "Can I get logcat logs after phone reboots?"
BootLoader How to get kernel messages from Android?
flashmyandroid How to get logcat and dmesg outputs for trouble shooting !
Stackoverflow Android: How to get kernel logs after kernel panic?
Stackoverflow Shutdown Log in Android