在使用adb logcat來拉取終端的本地日誌時想過濾出其中的想要的數據,就想到用linux下的| grep來過濾,結果悲劇了,如下圖所示:
研究了一下,原來windows是沒有grep的,搞混了很尷尬,既然此路不通那就換條路走;
方法一:
在shell命令下執行grep
adb shell "logcat |grep pinduoduo"
方法二:
adb logcat | findstr pinduoduo
tips:
第二種方法過濾出來的日誌會很多,可以加上tag,加強過濾粒度;
adb logcat -s TAG xxxx | findstr pinduoduo