一. android log:
以下5个非常好用:
adb logcat *:V 可以把V 以上的log都显示出来。
adb logcat -s TAG 可以显示出该TAG的日志。
adb logcat -c && adb logcat logcat 缓冲清空以及显示新的。
adb logcat | grep string 过滤出显示含有显示的字符串。
adb logcat | grep -v "^..str1\|^..str2" 过滤掉显示str1, str2 的tag, ^.. 表示开头第三个字符, \为转义符号。
adb logcat > a.log 重定向到a.log
二. kernel log:
adb shell cat /proc/kmsg | grep "string" 循环显示kernel 中的显示string 的信息
adb shell dmesg 显示当前缓冲区中的信息
adb shell dmesg -c && adb shell cat /proc/kmsg | grep "string" > a.log 清空并重定向到a.log