怎么用 adb 和 grep 过滤日志的多个标签

2019-03-22 11:36:08 +08:00
 twirain

adb -s emulator-5554 shell "logcat | grep tracking_id"

这样使用是没问题的,当我想加一个标签时,

adb -s emulator-5554 shell "logcat | grep tracking_id|GameInfo_RoleInfo"

/system/bin/sh: GameInfo_RoleInfo: not found

5341 次点击
所在节点    Android
5 条回复
yukiww233
2019-03-22 11:43:22 +08:00
adb shell "logcat |grep -E 'tracking_id |GameInfo_RoleInfo'"
iwtbauh
2019-03-22 15:39:39 +08:00
adb shell logcat | egrep '...'

用本机的 grep 岂不是更好

Android 带的 grep 并不一定好用
mxi1
2019-03-23 22:46:41 +08:00
上 cygwin, 用 cygwin 的 shell 调用 adb logcat |egrep “ aaa|bbb|ccc"
boolean93
2019-03-24 01:07:06 +08:00
哪需要写那么复杂...直接 adb logcat | egrep "tracking_id|GameInfo_RoleInfo"
cdlnls
2019-03-24 09:24:27 +08:00
adb -s emulator-5554 shell "logcat | grep tracking_id| grep GameInfo_RoleInfo"

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/547335

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX