Script to capture screenshot to file from adb connected Android device and saves to ~/Desktop.
Usage:
Save to auto-generated file name. Example: ~/Desktop/adb-cap-2018-02-12_09-59-41.png
./adb-cap.sh
Save to named file ~/Desktop/screen1.png
./adb-cap.sh screen1.png
or
./adb-cap.sh screen1