2010-11-05:
Managing iPhone iOS4 Music on Ubuntu Linux

Those of us with iPhones who don't use Windows or Mac are without iTunes, and hence have a hard time getting music to/from our iPhone. There are a plethora of answers that work in various degrees. After much research, here is what I have learned:

The following methods are discussed:

gtkpod/Amarok | PwnTunes | mewseek | xpod

And also ways to manage files to/from the iPhone:

ifuse | ssh | iproxy | Safari download plugin | PwnTunes

I use PwnTunes because it can import cover art easily and uses the builtin iPod player.

Managing Music

gtkpod / Amarok This is what I used on my first gen iPhone, but I couldn't get this to work on my iPhone 4 with iOS4 on Ubuntu hardy. I believe this works with newer Ubuntu versions, but I'm not currently able to upgrade because of hardware.
The following all require jailbreak and transferring files to/from the iPhone:
PwnTunes
($12.29, free trial)
Serves two purposes:

  1. Allows iPhone to act as a USB disk, making it easy to transfer files
  2. Imports songs in a drop folder (Media/My Music) into your iPod database

The first doesn't work out-of-the-box with Ubuntu, though there are possibly workarounds - you need MTP or PTP disk access. See below. I wasn't concerned because I had many methods for managing files on my phone.

The second one works, but if you don't use the first purpose, then you need to start the update manually. The process is simple:

  1. Load files into 'Media/My Music'
  2. Put in any cover art you want as Cover.jpg
  3. Launch 'Settings' on the iPhone
  4. Choose 'PwnTunes'
  5. Turn on 'Needs Sync' (and optionally 'Reset Imports')
  6. Start up iPod
    (If you chose 'Reset Imports' then iPod will quit, just start it again)
mewseek
($9.99, free trial)
mewseek can import music found in a drop folder (Downloads), the free trial can do 10 imports. This is great solution, but it doesn't support adding cover art, so any cover art must be in the APIC tag embedded in your MP3 file, which is not how most of my music is setup, which is why I chose the similar PwnTunes.
xpod
($2.99)
A replacement for the iPod player. Nice, but:
  • Crashes on large lists. Author claims this is a bug in NSFileManager, which may be true, but doesn't change the fact that it crashes. Bug filed and author is looking into it.
  • Has a few small bugs with mixing directories and mp3s together.
  • Can NOT be controlled by either clicking on the headphones or else from the iPod controller in the dock.
  • No playlist support. I got around this by using links, but ran into the large list problem.
  • Could automatically download cover art (which is great) though I think it was using Amazon and this is no longer working. There's also no way to turn off this behavior.

I used this as my solution for a while, I wrote a script which would copy files from a Playlist on my computer over to the iPhone as well as setting up directories of symbolic links that allow me to browse the collection by artist, alphabetically, or looking at all songs (though see the large list bug).

The script is available here: iSync, you will need to edit the variables at the top of the script before running. It requires the mzmv script from MarginalHacks. It can also convert oggs to mp3s on the fly for you, this requires that you also have the ogg2mp3 script also from MarginalHacks.

Transferring Files to/from Linux - iPhone

There are many options for transferring and managing files on the iPhone:
USB ifuse / usbmuxd Install ifuse and libiphone0, then you can mount your iPhone over USB:
% mkdir /media/iPhone	# Needed first time
% sudo usbmuxd		# After each reboot
% ifuse /media/iPhone
# Access your files now
% fusermount -u /media/iPhone
This will mount the phones ~/Media directory, you can also mount root by using 'ifuse --root'
net ssh / scp If you're on a network, you can ssh to your iPhone and also use scp. This is what I usually use when networked.
USB iproxy / ssh You can also use usbmuxd to ssh over a USB connection
% sudo usbmuxd		# After each reboot
% iproxy 5000 22 &
% ssh root@localhost -p 5000
Be sure to kill iproxy after you're done with it.
net Safari download plugin / iFile app You can also use the download plugin in Safari to download files, and then move them with the Cydia 'iFile' application. iFile is shareware, and there are many other such Finder replacements available as well.

This is too cumbersome for the number of files I want to transfer and move, so I don't use it.

PwnTunes mtp support I couldn't get this to work. I tried:
% mkdir /media/iPhone
% apt ins mtpfs
% mtpfs /media/iPhone
# Access files here...
% fusermount -u /media/iPhone
But I got "Transport endpoint is not connected"


Back to Solutions.

DaveSource.com - Dave's geek site GetDave.com - all the current Dave Pointers. MarginalHacks - I have an elegant script for that, but it's too small to fit in the margin.