tldr/pages.zh/common/adb-logcat.md

37 lines
925 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# adb logcat
> 转储系统消息日志。
> 更多信息:<https://developer.android.com/tools/logcat>.
- 显示系统日志:
`adb logcat`
- 显示符合正则表达式的行:
`adb logcat -e {{正则表达式}}`
- 显示特定优先级下V详细D调试I信息W警告E错误F严重错误S静默标记的日志过滤掉其他标记
`adb logcat {{标记}}:{{最低优先级}} *:S`
- 在详细V模式下显示 React Native 应用程序的日志静默S其他标记
`adb logcat ReactNative:V ReactNativeJS:V *:S`
- 显示优先级为警告W及以上的所有标签的日志
`adb logcat *:W`
- 显示特定 PID 的日志:
`adb logcat --pid={{pid}}`
- 显示某个特定软件包的进程日志:
`adb logcat --pid=$(adb shell pidof -s {{软件包}})`
- 给日志着色(通常与过滤器一起使用):
`adb logcat -v color`