Skip to content

Instantly share code, notes, and snippets.

@dominics
Created February 20, 2012 06:21
Show Gist options
  • Save dominics/1868109 to your computer and use it in GitHub Desktop.
Save dominics/1868109 to your computer and use it in GitHub Desktop.
Quick script to rsync music off an iPhone
#!/bin/bash
# vim: set ts=4 sw=4 tw=79 et :
#
# rsyncs the music from an iPhone into the iphone directory
if [[ ! -z "$1" ]]; then
ADDRESS="$1"
else
# Attempt to use avahi to get the iPhone's IP
# - Make sure your iPhone is unlocked
# - Start Remote on the iPhone
# - Settings, Add library, (you'll be shown a passcode)
# - No, I don't know any way to get the iPhone to show up in mdns when
# it's not on this screen
# - Edit the device name below
DEVICE="Dominic-Scheirlincks-iPhone"
# If you've followed the instructions above, see the DvNm field in:
# avahi-browse -r -k _touch-remote._tcp
ADDRESS=`avahi-resolve -n "$DEVICE.local" | col | cut -f 2`
fi
echo "Connecting to iPhone at $ADDRESS"
rsync -avz --progress \
"root@$ADDRESS:/private/var/mobile/Media/iTunes_Control/Music/" \
iphone
@mindylynn0
Copy link

Rsyncs the music from an iPhone into the iPhone directory~with iTunes alternative to put music on iPhone without iTunes.

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