https://github.com/banool/iphone-photo-sync-on-connect
https://github.com/banool/iphone-photo-sync-on-connect
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/banool/iphone-photo-sync-on-connect
- Owner: banool
- Created: 2021-06-25T18:31:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-12T16:53:55.000Z (almost 5 years ago)
- Last Synced: 2025-03-14T23:43:24.033Z (over 1 year ago)
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iPhone photo sync on connect
**Note**: The new Google Drive desktop client release 2021-08 supports uploading pictures from a plugged in iPhone to both Google Drive and Google Photos at the same time. This is no longer necessary.
## Setup: Run manually
First, make sure you have rsync and ifuse. You can get rsync from brew easily enough, but getting ifuse to work is a bit tricky. See here: https://sudonull.com/post/25455-Mount-iOS-under-OSX-using-ifuse.
First off, cp the syncing script into the **parent** directory of the location where you want the photos to sync to:
```
cp iphone_photo_sync.sh gdrive/pictures
```
Next, make sure to set `DESTINATION` in the copied `iphone_photo_sync.sh` to the destination directory you want to sync the photos into. `DESTINATION` is relative to the location of `iphone_photo_sync.sh`.
## Setup: Trigger automatically
First, do the manual stuff above. Now at this point, you can run the sync script manually, but to do it automatically, follow these steps:
Build xpc_set_event_stream_handler and put it in place:
```
cd ~/github
git clone git@github.com:himbeles/mac-device-connect-daemon.git
gcc -framework Foundation -o xpc_set_event_stream_handler xpc_set_event_stream_handler.m
cp set_event_stream_handler /usr/local/bin/
```
This makes sure that our plist, which we install later, only runs once on connect.
Next, create a symlink to the script in the sync location in /usr/local/bin:
```
ln -s /Users/dport/gdrive/pictures/iphone_photo_sync.sh /usr/local/bin/iphone_photo_sync
```
Next we need to modify the plist so that `idVendor` and `idProduct` are correct. Follow the README here for guidance: https://github.com/himbeles/mac-device-connect-daemon.
Finally, install the plist:
```
cp com.iphonephotosync.plist /Library/LaunchDemons
sudo chown root:wheel /Library/LaunchDaemons/com.iphonephotosync.plist
launchctl load /Library/LaunchDaemons/com.iphonephotosync.plist
```