Tag Archives: ADB

Android ScreenCap with ADB

I found a great blog post on how to capture a screenshot from a connected device using ADB – I know I can use eclipse or android studio to do it, but I wanted a quick grab from the command line, and I didn’t want to be bothered with capping it to the local disk of the android device.

Anyway, here’s the one liner that works on MacOS:

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png