我们知道,在Android中我们可以使用命令来过滤日志:
adb shell logcat | grep "tag1"
然后输出包含tag1的日志。
现在,我想使用一个可以输出包含 tag1 和 tag2 的日志的命令。
我正在尝试使用,但它无法工作。
adb shell logcat | grep "tag1 tag2"
怎么做?
最佳答案
正确使用 grep 的方法:
adb shell logcat | grep -E "tag1|tag2"
或者您可以只使用 logcat 的内置过滤器:
adb logcat -s tag1:* tag2:*
关于android - 如何一次使用多个标签过滤 Android adb shell logcat?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16995769/