Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Last active September 24, 2021 16:51
Show Gist options
  • Save kfatehi/8922430 to your computer and use it in GitHub Desktop.
Save kfatehi/8922430 to your computer and use it in GitHub Desktop.
Compiling libimobiledevice on Raspberry Pi

iPhone Tethering on Raspberry Pi

The instructions here are useful although the current packages in Arch and Debian repositories do not work with iOS 7 (Trust Loop Bug) but it is still a good starting point to understand how this works.

https://wiki.archlinux.org/index.php/IPhone_Tethering

iOS 7 Support

Install libimobiledevice from latest source

In order to get iOS 7 support, we need to compile everything from master -- See the attached script for your distribution.

Usage

Mounting your iPhone

Start usbmuxd: usbmuxd

Create a mount point: mkdir /media/iphone

Mount the device: ifuse /media/iphone

(You can unmount using umount /media/iphone)

You should now be able to view the contents of your iPhone.

Networking

At this point you should reboot so that modules and rules get loaded. After that, I gave up on ArchLinux due to issues getting actual network traffic to go across, so I can't speak for ArchLinux from herein. However I did have success on Raspbian. You should be able to simply plug in your iPhone and see a new interface come up and be able to ping the outside world. Enjoy!

pacman -Syu vim tmux git base-devel libxml2 python2 fuse
mkdir iphone_libs && cd iphone_libs
git clone https://github.com/libimobiledevice/libplist.git
git clone https://github.com/libimobiledevice/libusbmuxd.git
git clone https://github.com/libimobiledevice/usbmuxd.git
git clone https://github.com/libimobiledevice/libimobiledevice.git
git clone https://github.com/libimobiledevice/ifuse.git
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
cd libplist && ./autogen.sh && make && make install && cd ..
cd libusbmuxd && ./autogen.sh && make && make install && cd ..
cd libimobiledevice && ./autogen.sh && make && make install && cd ..
cd usbmuxd && ./autogen.sh && make && make install && cd ..
cd ifuse && ./autogen.sh && make && make install && cd ..
groupadd -g 140 usbmux &>/dev/null
useradd -c 'usbmux user' -u 140 -g usbmux -d / -s /sbin/nologin usbmux &>/dev/null
passwd -l usbmux &>/dev/null
echo /usr/local/lib | sudo tee /etc/ld.so.conf.d/libimobiledevice-libs.conf
sudo ldconfig
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install vim tmux git build-essential libxml2-dev python2.7 python2.7-dev fuse libtool autoconf libusb-1.0-0-dev libfuse-dev
mkdir iphone_libs && cd iphone_libs
git clone https://github.com/libimobiledevice/libplist.git
git clone https://github.com/libimobiledevice/libusbmuxd.git
git clone https://github.com/libimobiledevice/usbmuxd.git
git clone https://github.com/libimobiledevice/libimobiledevice.git
git clone https://github.com/libimobiledevice/ifuse.git
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | sudo tee -a /etc/bash.bashrc
cd libplist && ./autogen.sh && make && sudo make install && cd ..
cd libusbmuxd && ./autogen.sh && make && sudo make install && cd ..
cd libimobiledevice && ./autogen.sh && make && sudo make install && cd ..
cd usbmuxd && ./autogen.sh && make && sudo make install && cd ..
cd ifuse && ./autogen.sh && make && sudo make install && cd ..
groupadd -g 140 usbmux &>/dev/null
useradd -c 'usbmux user' -u 140 -g usbmux -d / -s /sbin/nologin usbmux &>/dev/null
passwd -l usbmux &>/dev/null
echo /usr/local/lib | sudo tee /etc/ld.so.conf.d/libimobiledevice-libs.conf
sudo ldconfig
@styro2000
Copy link

hello,
while compiling on 2015-05-05-raspbian-wheezy it gives me a
/usr/bin/ld: usbmuxd-utils.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.4'
error...

to fix the compilation error change:
/home/pi/iphone_libs/usbmuxd/autogen.sh line 18
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

to

if [ -z "$NOCONFIGURE" ]; then
LDFLAGS=-lrt ./configure "$@"
fi

not nice but it seems to work... :-)

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