Close

Yet another adb logcat

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 11/05/2018 at 05:230 Comments

The greatest struggle for Android developers is adb not filtering output based on the name of the process like the IDE does.  There are many hugely complicated attempts to do it using scripts.  The lion kingdom decided to do a simpler attempt in C.  Funny how writing scripts was what script kiddies did while C was professional.  Now, C makes you irrelevant while writing scripts is professional.

https://cdn.hackaday.io/files/1380505906331200/logcat.c

It constantly reads the process table  for any process matching the keyword.   The keyword is the full package name or a part of it.  It then filters the adb logcat output by the process ID.  If the program is restarted, it detects the new PID & continues reading.  It can exclude the verbose messages or just print info messages.  All the output is written to a file.

Discussions