Take Android and iPhone screenshots using terminal
Here's a handy little script to take screenshots from a connected iPhone and/or Android device and save them directly to your MacBook. Yay, no more e-mailing or AirDropping screenshots to yourself!
adb get-state 1>/dev/null 2>&1 && adb exec-out screencap -p > ~/Downloads/"$datetime-android.png" && sips -Z 1024 ~/Downloads/"$datetime-android.png"
idevice_id -l | grep -q '\d' && idevicescreenshot ~/Downloads/"$datetime-ios.png" && sips -Z 1024 ~/Downloads/"$datetime-ios.png"
It first checks if an iPhone or Android device is connected and then saves a screenshot to your
Downloads folder on your MacBook. The name contains the timestamp and a
-ios suffix. Screenshots are automatically resized to make them smaller so Jira doesn't freak out.
For iOS you need to install
brew install libimobiledevice). As usual, USB debugging is required for Android.