Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter Android adb shell logcat using multiple tags at one time?

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?

like image 685
Jerikc Avatar asked Jun 08 '13 03:06

Jerikc


1 Answers

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:*
like image 200
Alex P. Avatar answered Oct 06 '22 13:10

Alex P.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!