github twitter linkedin instagram
Coloured output for ADB logcat
Apr 2, 2014
One minute read

I always love nice colour coded debug messages, but all of the adb wrappers that currently exist seem to be far more complex than they really need to be.

So I rigged up this little bash script to neatly colour logcat.


# Argument 1 is the optional log tag name.
# Always should ERRORS from the android runtime because that is where the
# exception message are generated from.
[ $1 ] && args+="$1:* AndroidRuntime:E *:S"

adb logcat $args | perl -pe '

As a bonus, you may specify your application tag name as the first argument to only show the output for messages with that tag. Note that it will also only show error-level messages from AndroidRuntime. (This is so that stack traces will be visible and such).

Back to posts