Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wnarifin/2e55b071af907f4eea8e537bf7f44110 to your computer and use it in GitHub Desktop.
Save wnarifin/2e55b071af907f4eea8e537bf7f44110 to your computer and use it in GitHub Desktop.
Connecting iPhone (iOS 10) to Linux Mint 18

Why this document?

I was unable to import photos from my iPhone (using iOS 10) in Linux Mint 18. The libimobiledevice and ifuse that come with the distro didn't work.

The solution is to compile libimobiledevice and ifuse from source.

I forked this document from other Gists to document what works for me in Linux Mint 18. It worked for me on Linux Mint 18.3 with iOS 10.3.3.

Setup environment

Set up your environment before building. You may build and install packages to your home directory at $HOME/usr,

sudo apt-get install -y build-essential git

Edit .bashrc and include the following lines,

[ ! -d "$HOME/usr/src" ] && mkdir -p "$HOME/usr/src"
export PKG_CONFIG_PATH="${HOME}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
export CPATH="${HOME}/usr/include:${CPATH}"

export MANPATH="${HOME}/usr/share/man:${MANPATH}"

export PATH="${HOME}/usr/bin:${PATH}"
export LD_LIBRARY_PATH="${HOME}/usr/lib:${LD_LIBRARY_PATH}"

Notes:

  • Important! PATH and LD_LIBRARY_PATH is important because it is the runtime of libimobiledevice and ifuse to fix mounting iOS 10 devices.
  • MANPATH is only used when looking up man pages so it's optional (I recommend it).
  • PKG_CONFIG_PATH and CPATH is used at compile time to resolve dependencies.

Make sure to refresh the enviroment,

source ~/.bashrc

Build libimobiledevice and ifuse from sources

Install development packages,

sudo apt-get install libbz2-dev python-dev autoconf automake libtool pkg-config libplist-dev libplist++-dev libusb-1.0-0-dev libgcrypt20-dev libgnutls28-dev libgpg-error-dev libfuse-dev libssl-dev cython

Clone the sources,

cd ~/usr/src
for x in libusbmuxd usbmuxd libimobiledevice ifuse; do git clone https://github.com/libimobiledevice/${x}.git;done

Now build in the following order (the order matters),

  1. libusbmuxd
  2. libimobiledevice
  3. usbmuxd
  4. ifuse

1. Build libusbmuxd

cd ~/usr/src/libusbmuxd
./autogen.sh --prefix="$HOME/usr"
make && make install

2. Build libimobiledevice

cd ~/usr/src/libimobiledevice
./autogen.sh --prefix="$HOME/usr"
make && make install

3. Build usbmuxd

Unfortunately, sudo make install is required because it needs to write to /lib/udev/rules.d and /lib/systemd/system.

cd ~/usr/src/usbmuxd
./autogen.sh --prefix="$HOME/usr"
make && sudo make install

4. Build ifuse

cd ~/usr/src/ifuse
./autogen.sh --prefix="$HOME/usr"
make && make install

Connect iPhone

Create a mount point and verify the paths of the tools before mounting using ifuse,

$ mkdir -p ~/usr/mnt

$ type -p ifuse
/home/username/usr/bin/ifuse

$ type -p idevicepair
/home/username/usr/bin/idevicepair

Now attempt to mount using ifuse,

$ idevicepair pair
SUCCESS: Paired with device *****

$ ifuse ~/usr/mnt/

$ ls ~/usr/mnt/
AirFair  Books  CloudAssets  DCIM  Downloads  FactoryLogs  iTunes_Control  MediaAnalysis  PhotoData  Photos  PhotoStreamsData  PublicStaging  Purchases  Radio  Recordings  Safari  Vibrations

The photos are in DCIM folder.

When you're finished, unmount ~/usr/mnt using fusermount. For example,

fusermount -u ~/usr/mnt
Copy link

ghost commented Jun 8, 2020

All steps are okay but when i reach the command:
idevicepair pair

I got this message:

ERROR: No device found!
Is the device properly connected?
If it is make sure that your user has permissions to access the raw USB device.
If you're still having issues try unplugging the device and reconnecting it.

but when I run the command:
lsusb
I find My device.

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