Apple iPod, iPad, iPhone

This is a placeholder for a more comprehensive article on how to manage an Apple device on a Gentoo system. The goal is to mount the iPod/iPhone/iPad somewhere so that it can be interfaced with by other tools, such as or  or others.

The idevice Software Stack
This is the idevice software stack. The dependencies will be pulled in automatically, but this is useful as a reference when trying to figure out which layers are or are not working.



Pairing
Pairing functionality is provided by. Emerge it, then test it by running:

This should print the device serial number which appeared in your dmesg log.

If this has been successful, run:

to verify that communications with the device are functioning correctly.

Now run:

to pair with the device. Check this with:

Mounting
is supported by, so if you use Gnome, it's easy for you. If not,you will need. Both of these will mount /var/root/Media from the idevice to a target directory. If your device is 'jailbroken', you may use the --root flag to gain access to the root of the device.

Note that media files must be in /var/mobile/Applications//.data/Movies/ to be accessible by applications running on the device. More on this later.

Simply emerge gvfs with USE="ios", and it should auto-mount it for you.

First, emerge ifuse, then try running it:

Users wishing to access the idevice must be members of the plugdev group, and must have write-access to the mount point. [RootCmd|gpasswd -a USER plugdev] Remember, you need to start a new user session after doing this for it to take effect. Most users quit their window manager and re-enter it to do this.

Create a mount-point for the Media folder on the device. {{RootCmd|mkdir /media/ipad-Media]

Create some App-specific mount points (I use the AppIDs as directory names, more on finding them later) {{RootCmd|mkdir /media/ipad-com.apple.iBooks /media/ipad-com.olimsoft.oplayer.hd.lite}}

Set appropriate permissions. {{RootCmd|chown root:plugdev /media/ipad*}} {{RootCmd|chmod 775 /media/ipad*}}

Now mount the device as a user. First, the Media "partition": {{Cmd|ifuse /media/ipad-Media}} Now an App's Documents folder: {{Cmd|ifuse --appid com.olimsoft.oplayer.hd.lite /media/ipad-com.olimsoft.oplayer.hd.lite}} Finally, the device root (jailbroken devices only): (UNTESTED) {{Cmd|ifuse --root /media/ipad-root}}

If the preceding steps worked, this should be enough to mount the device. This can be automated using udev and whatnot (see udev documentation for this).

You should note that the author's experience is that throughput is slow, and is seriously affected by multiple copies in parallel - iotop reports transfer rates of approximately 1200 KiB/s for a single transfer, but a total of 600 KiB/s for two in parallel.

For transferring audio files to the idevice, mount the Media partition, make sure that your user can read and write files there and point gtkpod at it.

To Apps on the iDevice
ifuse can also mount areas of the ipad by AppID, which allows the user to transfer files, which may then be used by the particular application. The AppID is a kind of namespace, particular to each application.

To find these AppIDs, you must install.

List the AppIDs of the Apps currently installed on your device.

Mount by AppID:

Now you are free to copy files to the mounted folder, which will be accessible to that App (iBooks in this example).

QueryType failed, error code -256
This error either appears on its own or followed by failed XML parsing, such as:

In 2011-11, this was due to an Apple update, and git versions of and  were needed

error opening socket
If your device was connected before installing imobiledevice, you can might get

Unplug and replug your device, and try again.

GnuTLS Error: A TLS packet with unexpected length was received
In 2010, this could be solved by re-merging and. Forum Thread.

Permissions
Make sure that you are mounting as a normal user

External resources

 * Marcan's Blog
 * HFS+ on Unofficial Gentoo Wiki
 * unl0cker's Hackintosh Post