Another solution would be like a jpg response, but in a different direction - redirecting the kernel message to logcat. This is better because too many logcat messages can overload the serial console (if active).
you can run this in the android shell:
cat /proc/kmsg | while read LINE; do echo '\06kernel\0'$LINE'\0' > /dev/log/main; done
or this is in the host shell:
adb shell '(cat /proc/kmsg | while read LINE; do echo \\06kernel\\0$LINE\\0 > /dev/log/main; done)'
The first time you run the command, you will see all current dmesg messages in one place, but any subsequent messages will alternate when they appear.
and then learn logcat in a different shell. If you check logcat with -v time, kernel messages will contain both the logcat tag and the kernel timestamps. Of course, there may be delays between them.
Another, even simpler way to view alternating messages would be:
adb shell '(logcat & cat /proc/kmsg) > /path/to/log/file'
But in this case, itβs a little harder to identify messages coming from the kernel, and you cannot tell how the timestamps of the kernel relate to the logcat timestamps.
source share