How to capture a logcat (non-root and root)


Logcat helps you diagnose the errors of app, hardware, etc
There are two ways to capture a logcat

Non-rooted device:
Install adb if you haven’t install it yet https://forum.xda-developers.com/showthread.php?t=2588979

On your device, enable USB-debugging and connect to your computer

Launch CMD or Powershell and type the command to output logcat to file

adb logcat > “E:/ log cat.txt”
Always use quotes if the path contains spaces. Many peoples don’t know this trick

Reproduce the problem on your device in order to grab the interesting errors in logcat

Nothing will appear in the prompt while outputting to file. To stop it, press CTRL+C or close the prompt

The file will be saved

Rooted device:
There are many different apps of logcat reader
Don’t know which one? Just install MatLog. I recommended it: https://play.google.com/store/apps/details?id=com.pluscubed.matlog

Launch MatLog, click on 3 dots -> File -> Record


Name the file or just click OK

Reproduce the problem on your device in order to grab the interesting errors in logcat
To stop logcat, stop it from notification or on the app.


The .txt will open straight away after that

Understanding logcat:
It’s hard to explain but I can explain some of them

Logcat have following priorities:
V: Verbose
D: Debug
I: Info
W: Warning
E: Error
F: Fatal

The log message format is usally like:
date time PID-TID/package priority/tag: message

For example, the following log message has a priority of D and a tag of FireBaseApp:
07-26 17:10:26.237  9949  9949 D FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.

If you know the internals of app, hardware, etc. You will understand the log. You can always search on Google

It’s better to read the log from bottom and scroll up to find errors and understand activities easier, like I always do without using search.

Kommentarer