Skip to content

Instantly share code, notes, and snippets.

@dbalan
Created July 7, 2016 06:58
Show Gist options
  • Save dbalan/e58f51b713bfd6d711fd02061e27ca90 to your computer and use it in GitHub Desktop.
Save dbalan/e58f51b713bfd6d711fd02061e27ca90 to your computer and use it in GitHub Desktop.
Get screenshot from a pre ICS android.
#!/bin/bash
# works only with linux, depends on ffmpeg and android-tools installed.
# both `which ffmpeg` and `which adb` should return 0
set -e -x
if [[ $# != 1 ]]; then
echo "Usage: $0 filename.png"
exit 0
fi
adb pull /dev/graphics/fb0 /tmp/tmpfbgrab
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 320x480 -i /tmp/tmpfbgrab -f image2 -vcodec png $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment