This can be achieved by putting your iPhone into 'manual mode.' The following article explains how to do so, and provides further information regarding this setting.
By default, your device is set to "Automatically sync songs…," sometimes called automatic mode. To transfer music from multiple computers, your device must be set to "Manually manage music," sometimes referred to as manual mode.
All the best,
Sorry Allen. You're wrong.
This can NOT be done with an iPhone. The title of the article is misleading.
Read the disclaimer at the bottom of the article:
- iPod shuffle and iPhone are intended for use with a single computer. You cannot load music from multiple computers or iTunes libraries onto iPod shuffle and iPhone like you can with other devices.
There is a workaround but it certainly isn't supported behaviour or addressed in that article. Managing an iPhone should really be done from a single library that has all the content that needs to go onto the device. If manually managing the iPhone from multiple computers is a priority then the method is shown below.
Sync iPod/iPad/iPhone with two computers
Although it isn't possible to sync an Apple device with two different libraries it is possible to sync with the same logical library from multiple computers. Each library has an internal ID and when iTunes connects to your iPod/iPad/iPhone it compares the local ID with the one the device normally syncs with. If they are the same you can go ahead and sync...
I have my library cloned to a small 1Tb USB drive which I can take between home & work. At either location I use SyncToy 2.1 to update the local copy with the external drive. Mac users should be able to find similar tools. I can open either of the local libraries or the one on the external drive and update the media content of my iPhone. The slight exception is Photos which normally connects to a specific folder on a specific machine, although that can easily be remapped to the current library if you create a "Photos" folder inside the iTunes Media folder so that syncing the iTunes folders keeps this up to date as well. I periodically sweep my library for new files & orphans withiTunes Folder Watch just in case I make changes at one location but then overwrite the library with a newer copy from the other. Again Mac users should be able to find similar tools.
As long as your media is organised within an iTunes Music or Tunes Media folder, in turn held inside the main iTunes folder that has your library files (whether or not you let iTunes keep the media folder organised) each library can access items at the same relative path from the library folder so the library can be at different drives/paths on different machines. This solution ensures I always have adequate backups of my library and I can update my devices whenever I can connect to the same build of iTunes.
When working with an iPhone earlier builds of iTunes would remove any file not physically present in the local library, even if there was an entry for it, making manual management practically redundant on the iPhone. This behaviour has been changed but it will still only permit manual management with a library that has the correct internal ID. If you don't want to sync your library between machines on a regular basis just copy the iTunes Library.itl file from the current "home" machine to any other you want to use, then clean out the library entries and import the local content you have on that box.