HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

logcat — Dump a log of system messages, including stack traces when an error occurred, and information messag

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandcliloglogcatdumpmessagesincludingsystem
mobile

Problem

How to use the logcat command: Dump a log of system messages, including stack traces when an error occurred, and information messages logged by applications. More information: <https://developer.android.com/tools/logcat>.

Solution

logcat — Dump a log of system messages, including stack traces when an error occurred, and information messages logged by applications. More information: <https://developer.android.com/tools/logcat>.

Display system logs:
logcat


Write system logs to a [f]ile:
logcat -f {{path/to/file}}


Display lines that match a regex:
logcat --regex {{regex}}


Display logs for a specific PID:
logcat --pid {{pid}}


Display logs for the process of a specific package:
logcat --pid $(pidof -s {{package}})

Code Snippets

Display system logs

logcat

Write system logs to a [f]ile

logcat -f {{path/to/file}}

Display lines that match a `regex`

logcat --regex {{regex}}

Display logs for a specific PID

logcat --pid {{pid}}

Display logs for the process of a specific package

logcat --pid $(pidof -s {{package}})

Context

tldr-pages: android/logcat

Revisions (0)

No revisions yet.