Skip to content

Instantly share code, notes, and snippets.

@juhnny5
Forked from apsun/iphone-music-sync.sh
Created September 28, 2021 09:04
Show Gist options
  • Select an option

  • Save juhnny5/8fd31e17e016b1b1c2755bf22178661f to your computer and use it in GitHub Desktop.

Select an option

Save juhnny5/8fd31e17e016b1b1c2755bf22178661f to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Sync music from Linux to iPhone using libimobiledevice + ifuse
# Only works with apps that can read songs from iTunes file sharing (e.g. Doppi)
set -euo pipefail
if [ $# -ne 1 ]; then
echo "usage: $0 <src dir>"
exit 1
fi
APP_ID="com.ondalabs.doppi"
mnt="$(mktemp -d)"
ifuse --documents "${APP_ID}" "${mnt}"
rsync --delete --archive --progress --inplace "$1" "${mnt}"
fusermount -u "${mnt}"
rmdir "${mnt}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment