Android studio 中过滤日志非常好用,支持根据包名过滤
下面通过命令行来实现:
Window:
adb shell ps |findstr "package" >temp.txt && for /f "tokens=2" %i in (temp.txt) do (adb shell logcat *:V|findstr %i)
Mac:
adb shell ps |grep "package"|awk '{print $2}' > temp.txt && adb logcat '*:V'| grep -f temp.txt
- 包名:替换package
- 日志级别替换:*:V
V — 明细 verbose(最低优先级)
D — 调试 debug
I — 信息 info
W — 警告 warn
E — 错误 error
F — 严重错误 fatal
S — 无记载 silent
此文要是对你有帮助,如果方便麻烦点个赞,谢谢!!!