Showing posts with label iTunes. Show all posts
Showing posts with label iTunes. Show all posts

Friday, September 2, 2011

Syncing your iPhone with multiple iTunes 10 libraries (updated)

Update (May 27th, 2014): 
Since many people seem to try this with iTunes 11, please be advised: I have not tried this with anything else than iTunes 10. Apple tends to change the internal workings of iTunes, especially between major releases. So don't expect this to work on any other version than 10.

Many people commented it doesn't work on 11 anymore. I couldn't test this since I'm not using this hack anymore nowadays, but I wouldn't be surprised if it is indeed so.



After getting a MacBook Air recently, I wanted to use my iPhone with iTunes on that machine. But when you try to sync an iPhone that has been synced with another iTunes-installation, you get an error and are only given the option to clear the library on your iPhone.

I remembered hacks for older versions of iTunes that let you clone the unique ID of one media library to another iTunes installation. The trick was to read the ID from the "iTunes Music Library.xml" of one iTunes-Installation and apply that to both the "iTunes Music Library.xml" and "iTunes Library.itl" (binary) of another installation. Newer iTunes-Versions (v10.4 at least, not sure when it was introduced) were changed to not make it as easy anymore by adding some sort of checksum to the binary file.

To get to the point: it's still possible, by doing the following steps:

1. On source-machibe: get your ID you want to clone (existing iTunes, with which your iPhone is synced)

  • go to your Home-directory -> Music/iTunes
  • open "iTunes Music Library.xml", the ID is in the <string>-tag after the "Library Peristent ID"-<key>.


2. On target-machine: clone ID to another iTunes installation

  • first, close and exit iTunes if it's still running
  • go to your Home-directory -> Music/iTunes
  • open "iTunes Music Library.xml" and overwrite the ID with the one you got from the other library in step 1
  • delete the file "sentinel". It might be hidden, so make sure you have your system set to show hidden files
  • now we need to "corrupt" the "iTunes Library.itl" file. Do this any way you want, I simply did a echo "junk" > iTunes Library.itl but whatever works for you. Deleting it and recreating a text-file with the same name will probably work as well.


3. have iTunes recreate the library

  • now restart iTunes. It should detect that the library is corrupted and will ask you if you want to have iTunes rebuild it. Say yes.
  • Done! Now you should be able to sync your iPhone with iTunes


Tuesday, August 12, 2008

How to use your iPhone media library on 2 comps simultaneously

And yet another post in the "why can't things simply work" category. I should probably add that category officially... Again I wanted some very special, exotic functionality from a software. This time it was iTunes (again) and the rediculous thing I wanted was to manage my iPhone music files manually from 2 comps. So I installed iTunes on a second comp and even unlocked it. 2 of 5 activations left, that's fine with me.

But as I tried to access the iPhone's music library, I got a message from iTunes telling me that the iPhone can only be synched to one Music Library at a time and if I wanted to sync it with this "new one", then all Media on the phone will be removed first. WTF?

I get the idea behind the iTunes Media Libraries and the approach they've chosen. But honestly, is it really that extraodinary to want to use your iPhone from 2 comps at the same time? Usually I just wanna copy over the one or the other file, song, video or delete some media files on the phone that I don't really need. I see why iTunes would complain if I had set it to keep the whole library synched, but if I check the "manage manually" option in iTunes, I don't wanna see a limitation like that.

After googling, I saw that I'm not the only one who would like to use that feature. And I stumbled over a solution too. It's quite easy and cheap:

http://www.andrewgrant.org/2008/03/30/how-to-sync-an-iphone-with-two-or-more-computers.html

Seems like every iTunes-installation creates a unique key for its media-library. If an iPhone is connected, it checks if that ID is equal to the one of the media library on the iPhone. If it's not, it won't allow you to modify the library on the phone. So all you need to do is to find 2 specific files and to replace the ID contained in those with the one of your previous installation. So then both iTunes Libraries have the same ID and voila, it works. It doesn't matter that the libraries don't contain the same files, but that's alright since all it does is to check the ID. And since I don't want to sync my whole library that way on two comps (since they are in different places and can't access the same files), I'm good.

Hmm, and just as a thought: By actually copying over those two files from one installation, you could probably duplicate your library on two iTunes installations easily - you just gotta make sure that the paths associated for the files themselves are identical on both machines. There might be additional files needed, like the CD-covers downloaded or so, but that's easy to figure out. Note to self: try this out one day.

Thanks go to "A blog by Andrew Grant", where I found the original idea (see the link above)