Files
tldr/pages.zh/android/logcat.md
2024-10-12 15:08:58 -07:00

25 lines
523 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# logcat
> 转储系统消息日志,包括发生错误时的堆栈跟踪信息,以及应用程序记录的信息消息。
> 更多信息:<https://developer.android.com/tools/logcat>.
- 显示系统日志:
`logcat`
- 将系统日志写入文件([f]ile
`logcat -f {{路径/到/文件}}`
- 显示与正则表达式匹配的日志行:
`logcat --regex {{正则表达式}}`
- 显示特定 PID 的日志:
`logcat --pid {{pid}}`
- 显示特定包的进程日志:
`logcat --pid $(pidof -s {{包}})`