Android and Linux

Wednesday, January 18, 2012

Screenshot command

This command will take a screenshot on Android ICS:

/system/bin/screencap -p /sdcard/FILENAME.png

You might want to make the filename be the date and time:

/sdcard/$(date +%m.%d.%Y-%H:%M).png

I found that in /system/bin/bugmailer.sh, a script to send bug reports. The p option and calling it a png file both seem to have the same result, but if you leave both off, it ends up as a data file that nothing will open. It seems redundant but for safety's sake, I'll follow their example of both using -p and naming it a png. Unfortunately, there are no other options.

It's a neat trick. With Tasker, I can trigger a screenshot and scp that sucker right to my computer automatically.

Followers