Skip to content

Instantly share code, notes, and snippets.

@JichunMa
Created April 1, 2019 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JichunMa/f438e013dab0efb202a0eb8cf0c39319 to your computer and use it in GitHub Desktop.
Save JichunMa/f438e013dab0efb202a0eb8cf0c39319 to your computer and use it in GitHub Desktop.
#! /bin/bash
dir=~/Desktop/screenshot/
curr=`date "+%Y-%m-%d %H:%M:%S"`
name=${dir}"screenshot"${curr}".png"
echo "${name}"
adb start-server
adb exec-out screencap -p > "$name"
if [ -n "$1" ]; then
echo "$1 秒后自动删除"
sleep $1
rm "$name"
else
echo "永久保存"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment