Skip to content

Instantly share code, notes, and snippets.

@rankun203
Last active August 29, 2015 14:08
Show Gist options
  • Save rankun203/836a82d8c637fec2253c to your computer and use it in GitHub Desktop.
Save rankun203/836a82d8c637fec2253c to your computer and use it in GitHub Desktop.
Import photos from an Android device that has Developer Options enabled in settings.
#!/usr/bin/env bash
# author: [email protected]
mkdir -p ~/tmp/dcim
echo "> Pull all the photos from my Phone?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo '> Pulling'; adb pull /storage/sdcard0/DCIM/Camera/ ~/tmp/dcim; echo '> Done'; break;;
No ) exit;;
esac
done
echo ''
echo 'Delete all photos on phone?'
select yn in "Yes" "No"; do
case $yn in
Yes ) echo '> Deleting'; adb shell "rm -r /storage/sdcard0/DCIM/Camera/"; echo '> Deleted'; break;;
No ) exit;;
esac
done
echo ''
echo 'Import them to iPhotos(Close iPhotos after import finished to continue.)?'
select yn in "Yes" "No"; do
case $yn in
Yes ) echo '> Opening iPhotos'; open -Wa iPhoto ~/tmp/dcim/*; echo '> Imported'; break;;
No ) exit;;
esac
done
echo ''
echo 'Deleting import cache from ~/tmp/dcim'
rm -rf ~/tmp/dcim/*;
echo '> Deleted';
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment