Getting a reliable, real-time screen of an Android device is more challenging than one might think, e.g. for the purpose of training a reinforcement learning agent.
This post describes a basic approach:
adb shell screencap -p
Sadly, adb mangles binary output and has a tendency to convert
\n to …