Logcat

From CyanogenMod Wiki
Jump to: navigation, search

Logcat is the command to view the internal log of the Android system. Viewing logcat is often the best way - and sometimes the only way - to diagnose a problem.

Contents

ADB Logcat

The best way to get logs is with ADB. This way you can view the log when the device is otherwise unusable (e.g. booting or stuck in a loop). With ADB setup, run the following from the command line:

adb logcat
NOTE: Googlers have a sense of humor, and adb lolcat works identically.

Press ctrl+c once you are done collecting information.

To save a log to a file,

adb logcat > logcat.txt
ctrl+c

From the device

There are several ways to pull logs directly from the device:

Terminal emulator

You can also run logcat from the command line on the device (terminal emulator, connectbot local, etc.):

logcat

Obviously the screen is tiny and copying from the terminal is annoying, so, similar to adb logcat:

logcat > /sdcard/logfile.txt

and then press the trackball (for ctrl) and c to end the output. If this doesn't work, try Volume-Down (for ctrl) and c to end.

Log Collector

BugReport.apk has been removed from CyanogenMod 5+. This information applies to CyanogenMod 4.2 & below.

An app included in CyanogenMod, Log Collector will allow you to send a logcat with gmail or by other means. Usually it's best to gmail the log to yourself, then copy the important bits into an issue report or pastebin to have someone else diagnose the problem.

If your CyanogenMod install doesn't include Log Collector, you can get it free from the market, by Xtralogic, inc.

Magic key combinations

BugReport.apk has been removed from CyanogenMod 5+. This information applies to CyanogenMod 4.2 & below.

You can use a magic key combination to create a bugreport file in /sdcard/bugreports. It will get you all the running processes, logcat, and more, and dump it to your SD card as /sdcard/bugreports/bugreport-xxxxxx where xxxxxx is the timestamp of the dump. this can also be started by the command on the devices shell "bugreport"

  • HTC Magic Menu + Back
  • HTC Dream Menu + left Shift
  • HTC Passion Trackball + Volume Up

The device will vibrate once, then it will vibrate three times to acknowledge that it is complete.

More information:

Personal tools