Is it possible to read information being sent over LogCat in python?
I have a program that is written in java.
Every draw frame it sends tag:"Fps: " message: number
I would like this message to fire an event that I can catch in my python script so I can draw a fps-meter.
Take a look at subprocess. The following code was adapted from Stefaan Lippens
Of course, you'll need to write the
is_fps_line
andupdate_fps
functions yourself.I would redirect
adb logcat
to your python script. This would look like:Now you can read from logcat on sys.stdin and parse it however you like.