how to filter Android adb shell logcat using mutip

2019-02-13 17:14发布

As we know , we can use the command to filter the log in android:

adb shell logcat | grep "tag1"

Then ,the logs which contain the tag1 will be output.

Now , I want to use one command that can output the logs which contain the tag1 and tag2.

I'm try to use , but it cannot work.

adb shell logcat | grep "tag1 tag2"

How to do it ?

Thanks.

1条回答
【Aperson】
2楼-- · 2019-02-13 17:44

This is how to use grep properly:

adb shell logcat | grep -E "tag1|tag2"

Or you could just use logcat's built-in filters:

adb logcat -s tag1:* tag2:*
查看更多
登录 后发表回答