Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@mikepenz 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