To take a screenshot from the screen of a Android device, a
commandline tool /system/bin/screenshot is present. At least on my
device, a (Aldi) AT-AS43D, running Android 4.0.3. So, to get a
screen shot on your PC from Android, you can use the following code:
adb shell screenshot /sdcard/myscreenshot.png
adb pull /sdcard/myscreenshot.png myscreenshot.png
adb shell rm /sdcard/myscreenshot.png
On my device however, the screenshot image looks wierd. Apparently
the red and blue channels in the image are swapped by the screenshot
tool. So I found a easy way to swap the colors back, using
'convert', which is part of the imagemagick package (on Ubuntu at
least). So the code becomes something like this:
adb shell screenshot /sdcard/myscreenshot$$.png
adb pull /sdcard/myscreenshot$$.png /tmp/myscreenshot$$.png
adb shell rm /sdcard/myscreenshot$$.png
convert /tmp/myscreenshot$$.png -separate -swap 0,2 -combine myscreenshot.png
rm /tmp/myscreenshot$$.png
This all has been tested on a Ubuntu PC. Other environments,
especially Micro$oft Windows, may need adaptation. Installation
requirements: adb (google for it, or install Android SDK);
ImageMagick.
Examples:
Alternatively, you can apparently press 'volume-down' and 'power' to
get a snapshot, since Android 4.0
And, a cheap Android 2.3 device does not have the 'screenshot' tool.
The tool, copied from my working device does in principle work, but
most data is not shown.
Apparently, on some 2.3 devices, a 'snapshot' option is in the menu that
comes up when holding the 'power' button. Alas, not on my cheap
one.
Also apparently, on some 2.2 devices, pressing the 'power' button
while holding the 'home' button takes a screen shot. But not my 2.3
one.