However I've had a problem that, according to online forums, appears to affect many people yet nobody seems to have described a good approach to resolving it. It involves syncing the iPhone with iTunes. Specifically syncing of Apps. Now and again (more often than not), syncing apps would cause all my carefully organised folders to 'explode'. Essentially, the folders are emptied into the main icon area, and removed. This is incredibly annoying.
There seem to be several different circumstances that lead to this 'explosion', but one circumstance is definitely reproducible - this is where you move your 'syncing' to a new computer. I just happened to have one, so I wanted to sync my iPhone with this computer, a perfectly natural thing to do. But as soon as I'd tick the 'sync apps' option, my folders would explode. Fortunately, this time, I observed that if I unticked the option immediately, my folders would be restored. If I click 'apply' or 'sync' I'm sure that would be the end of that.
Another situation involves adjusting folder contents on the device itself. The next time you sync with iTunes, there's a good chance you'll lose your folders.
So, to cut a long (8 hour) story short, this is what I did to enable app syncing and retain my beautiful folder structure.
- use iTunes to create a 'backup'.
- iTunes only keeps the last backup, so we need to ensure we 'capture' this for use later.
- make a copy of the backup directory (on OSX it's in ~/Library/Application Support/MobileSync/Backup) with a new timestamp. Something slightly different will be fine.
- edit Info.plist to change the Display Name key to something easily recognisable.
- Now we can restore this backup via iTunes (using the name set above) if we need to get our folders back. Unfortunately this also undoes the 'sync app' setting, so if you use this backup you will be back to square one.
- now we need to back up the Icon settings. There may be an easier and cheaper way to do this (such as using ssh to locate and scp to back up SpringBoard's IconState.plist file) but here's what I did:
- jail-broke my device (I used greenpois0n, on iOS 4.2.1)
- use Cydia to purchase PKGBackup (US$8)
- use PKGBackup to back up to Dropbox, specifically you want to back up the IconState.plist file
- Now I went back into iTunes and turned on 'sync apps'. Of course, my folders exploded, but I expected it this time. I synced and, yep, exploded folders. However now iTunes and the iPhone are talking to each other.
- (iTunes will have performed another backup before this sync, overwriting the last, which is why we made a manual backup in step 2)
- The last step is to use PKGBackup again to restore IconState.plist. This is the only file I restored (although a file called metadata insisted on coming along for the ride).
- After the restore completed and the iPhone rebooted, I had all my folders back! Yay!
As a side-effect, I'm also using PKGBackup to back up everything else that the iTunes 'backup' omits - which is mostly everything. Useful program.
LifeHacker's guide to PKGBackup