Skip to content

Instantly share code, notes, and snippets.

@riggaroo
Created April 30, 2020 08:34
Show Gist options
  • Save riggaroo/ff5076fbc400398bcdb3f2ac3b88aada to your computer and use it in GitHub Desktop.
Save riggaroo/ff5076fbc400398bcdb3f2ac3b88aada to your computer and use it in GitHub Desktop.
pull_screenshots.sh script from Chiu-ki Chan's video on terminal tricks https://youtu.be/1N90lU1xn2w
#! /bin/bash
today=$(date +%Y%m%d)
for path in $(adb shell ls /sdcard/Pictures/Screenshots/*"${today}"*); do
name=$(basename "$path")
if [ ! -f "$name" ]; then
adb pull "$path"
fi
done
@mikepenz
Copy link

mikepenz commented May 6, 2020

Not sure if it's due to zsh but I had to add ' around the shell statement. E.g.

adb shell 'ls /sdcard/Pictures/Screenshots/*'"${today}"'*'

Thanks a ton for creating this gist :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment