Connect iPhone to Arch Linux


Here's a method to download photos from your iPhone on Arch Linux. An unholy combination? Yeah, probably.

tl;dr

sudo pacman -S libimobiledevice # needed protocols to connect
yay -S ifuse # needed to mount
systemctl start usbmuxd.service # ensure service running
idevicepair pair # pair phone
mkdir /mnt/iphone # place to mount
sudo ifuse -o allow_other /mnt/iphone # mount phone
ls /mnt/iphone # go explore

Communicate with the iPhone

First, you need a library to help with the protocols to communicate with the iPhone. libimobiledevice will do that. Install it with:

sudo pacman -S libimobiledevice

Next, you want to make sure that the service to access USB devices is running. To do that, run:

systemctl status usbmuxd.service

If it's not active, you can start it

systemctl start usbmuxd.service

Query USB devices

You'll want to make sure you connect your iPhone to the computer with a USB cable. Make sure that you unlock the phone and "Trust this computer" when the phone brings up that dialog. Sometimes I have to plug in and unplug several times before I get this dialog.

Optionally, you can also do some detection of USB devices separate from the pairing (next step). A little lib called usbutils can help:

sudo pacman -S usbutils

Then you can run this to get a listing of USB devices (similar to lsblk):

lsusb

That will return a list of devices, including something like this iPhone item:

...
Bus 001 Device 005: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE
...

From libimobiledevice, you can also query about iPhones specifically:

ideviceinfo

Pair the iPhone

Now to be able to talk to the iPhone from the computer, you need to pair it with:

idevicepair pair

If all goes well, you'll see something like:

SUCCESS: Paired with device 00008020-001A44E40E99002E

Mounting the filesystem

To be able to browse and download files from the iPhone's filesystem, you need to mount it.

To allow mounting iOS devices, install this AUR package:

yay -S ifuse

Then create a place you want to mount it. For instance:

mkdir -p /mnt/iphone

The you can run this command:

sudo ifuse -o allow_other /mnt/iphone

Now if I was to navigate to /mnt/iphone, I might see something like:

/mnt/iphone🔒 ✦ ➜ ls -1
Books
CloudAssets
DCIM
Downloads
iTunes_Control
MediaAnalysis
PhotoData
Photos
Podcasts
Purchases
Recordings

Copy files

Now that the filesystem is mounted, one could copy files off of the iPhone with something like:

cp -r /mnt/iphone/DCIM ~/Downloads

Clean up

To clean up and reverse the process, unpair:

idevicepair unpair

And unmount:

sudo umount /mnt/iphone

What better ways are there to connect to an iPhone from Arch Linux?