Programming Tips - How can I do a screenshot from the command line?

Date: 2015may11 OS: Android Keywords: screen capture Language: Bash Q. How can I do a screenshot from the command line? A. If you have root access:
/system/bin/screencap -p /sdcard/screen.png
You may not need the full path of the command:
screencap -p /sdcard/screen.png
-p = use .png format.