How to capture a logcat - lineageOS 15.1

  • Install Termux app (from F-Droid).
  • Record logs to files:
    • Open Termux
    • Type in : su -c 'logcat > /sdcard/log.txt'

This will ask for root privileges, and if accorded, start recording the logs in a file, that you’ll be able to retrieve from the File managing app, at the root (upper folder) of your phone local storage.

The command ends by itself when your phone reboots, leaving the file at its last states in your filesystem. You can then give those logs to experts to help them diagnosing the problem (for instance in the Fairphone forum).

If you want to terminated the command (and so the recording) before your phone reboots, get the Termux app in foreground again and type CTRL+C if you can (using the hacker’s keyboard) or just terminate your Termux session.

  • Grab /proc/last_kmsg after a reboot:
    • In Termux, type : su -c 'cat /proc/last_kmsg > /sdcard/20180827_lkm.txt'

You’ll get the file <date>_lkm.txt in your local phone storage root.

Other resources :