Search
Recommended for You

iPhone Backups: Part 3


Parts 1 and 2 of this mini-series introduced you to mdbackup files. When backing up your iPhone or iPod touch, iTunes stores files in mdbackup property lists. The name mdbackup comes from mobile device, the name of the private framework that's responsible for handling the iPhone backups. Today, you'll discover how to extract file data from the backups.

Mdbackup files are property lists and are created in a compressed binary format. These files are just as readable from your Foundation Cocoa programs as any other property list. The key to recovering data lies in de-serializing the data stored in that property list dictionary.

Read mdbackup property lists into your program just as you would read any other plist, i.e.: [NSDictionary dictionaryWithContentsOfFile:mdbackupath];. This call creates a new NSDictionary object and initializes with the contents of the property list (or in this case mdbackup) file.

Once loaded, you may access the file data from the dictionary. Request the object associated with the @"Data" key (NSData *data = [mdbackupDict objectForKey:@"Data"]). Store that data out to disk ([data writeToFile:outfile atomically:YES]

The name of the file is stored in the @"Path" key. Use this value to restore the data to a file with the same name.

AddThis Social Bookmark Button
Comments (1)

1 Comments

Wale Ernie said:

Hi Erica,

Thanks for the useful information.
Is there a way to use this on the windows platform?

Thanks,
Wale.

Leave a comment