James Mardell

Debugging Android


As a fan of doing everything on the command-line with a hint of ANSI-abuse, I needed a way of viewing the live debugging logs from an Android device. Enter the terminal:

adb logcat | tee /tmp/android_logfile_`date +'%Y%m%d-%H%M%S'`.log | ./coloredlogcat.py

This snippet opens the Android Debug Bridge (ADB) and pipes the result through tee, to save the results to a sensibly named logfile. The result is piped through Jeff Sharkey’s logcat reformatting script so the result is nice and pretty:

Massively coloured logcat