logcat

Logcat read failure troubleshooting and fix record

After flashing lineage-16.0 on a retired OnePlus One, it had been running smoothly as a backup retro gaming device. Recently, when using it for Android debugging, I suddenly found that logcat was not responding. In Android Studio the log window was completely blank. The adb device status was normal, but running adb logcat or adb shell logcat showed the error ‘logcat read failure’.

I spent a long time investigating. I tried various methods. Rooted into /system/bin and confirmed that logd was intact. Some people suggested SELinux issues, so I checked with ls -Z and saw the permissions were u:object_r:logd_exec:s0, which looked fine. I suspected Magisk had broken the system, so I did a factory reset, but the error persisted.

Then I remembered that the system image I used previously was downloaded from some random website, and it came with many preinstalled junk apps. Maybe the ROM author had broken important functionality. So I searched and found an official lineage old version image: https://lineageosroms.com/bacon/#installing-lineageos-from-recovery

After reflashing with the pure official image, logcat worked normally again. Problem solved.