vinjn / articles

Everything is possible
8 stars 0 forks source link

adb_cheatsheet #7

Open vinjn opened 11 years ago

vinjn commented 11 years ago

filter logcat output http://developer.android.com/tools/debugging/debugging-log.html Every Android log message has a tag and a priority associated with it.

Using grep adb logcat -v time -d | grep <package-name>

A general syntax adb logcat <package-name>:<log level> *:S

Shortcut to mute other tags by -s, which means *:S adb logcat -S <package-name>

displays all log messages with priority level "warning" and higher, on all tags adb logcat *:W

Display messages with "ActivityManager" tag at priority "Info" or above and all log messages with tag "MyApp", with priority "Debug" or above, :S, sets the priority level for all other tags to "silent" `adb logcat ActivityManager:I MyApp:D :S`

vinjn commented 11 years ago

colorful logcat

http://jsharkey.org/blog/2009/04/22/modifying-the-android-logcat-stream-for-full-color-debugging/ http://jsharkey.org/downloads/coloredlogcat.pytxt

vinjn commented 11 years ago

log priority

vinjn commented 11 years ago

dump to local file adb logcat -d > logcat.txt

vinjn commented 11 years ago

tombstone

https://sites.google.com/a/itspaclub.com/www/android-debug/7-how-to-debug-native-code/7-6-android-tombstones

Every time a process crashes under Android, a so called Tombstone is written for the process. A tombstone is a file containing important information about the process when it crashed. A slimmed core dump of sorts

ll data/tombstones