Android - Is there a way to see the device's screen *live* on PC, through ADB?
screenrecord
screenrecord
is an internal Android executable that dumps screen to a file, and ffplay
from ffmpeg happens to be able to play an H.264 encoded stream from stdin
First enable ADB USB access and then on Ubuntu:
sudo apt-get install adb ffmpeg
adb exec-out screenrecord --output-format=h264 - |
ffplay -framerate 60 -probesize 32 -sync video -
You might have to make the screen move a bit before you see anything:
Uncut demo: https://www.youtube.com/watch?v=fVgeoMYm61Q
Explanation of parameters:
-probesize 32 -framerate 60 -sync video
reduce the delay between the image on the phone and the image on the disktop (thanks to @arbuz)- we use
adb exec-out
instead ofadb shell
because shell might mess up some control characters due to being a shell (thanks to @Bowi)
See also: Use adb screenrecord command to mirror Android screen to PC via USB
Tested on Ubuntu 20.04, Android 11, Pixel 3a.
Try the Android Screencast app.
See the XDA thread for more details.