Grabbing a screenshot from an Android device via adb

This blog entry has a very neat way of grabbing screenshots from Android mobile devices. It boils down to a one liner (reproduced here just in case that blog vanishes for some reason and so it’s easy to find):

adb shell screencap -p | sed 's/\r$//' > screen.png

on Linux and

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

on the Mac.

Works perfectly. Thanks!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s