Stupid iPhone Tricks
by adam on Mar.06, 2010, under apple, computers, tools
I learned something interesting today – you can get access to a bunch of logs from your iPhone, without jailbreaking it! There are number of SQLite databases stored in
~/Library/Application Support/MobileSync/Backup/
on your OS X machine that the iPhone syncs with.
The filenames are SHA1 sums of their location on the iPhone [src]. Through trial and error, I’ve figured out the following files that should be common to every iPhone:
992df473bbb9e132f4b3b6e4d33f72171e97bc7a.mddata Voicemail list
ff1324e6b949111b2fb449ecddb50c89c3699a78.mddata Call log
3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata SMS Log
740b7eaf93d6ea5d305e88bb349c8e9643f48c3b.mddata Notes database
31bb7ba8914766d4ba40d6dfb6113c8b614be442.mddata Contact List
The schema for most of these can be found here: http://damon.durandfamily.org/archives/000487.html (although he references their on-phone location, and talks about jailbroken phones, these SQLite DB files are accessible on your desktop machine, and are updated in place every time you sync your phone.
In addition to these, a few interesting DBs I found that are specific to apps installed on my phone are:
6639cb6a02f32e0203851f25465ffb89ca8ae3fa.mddata Facebook friends list
970922f2258c5a5a6d449f85b186315a1b9614e9.mddata Flightstats
5ad81c93601ac423bc635c7936963ae13177147b.mddata Daily Burn food log
Each of these database can be accessed via the sqlite3 command line tool for interactive use. For bulk processing and playing with stuff in a spreadsheet or other DB, you can dump whole tables to CSV easily with sqlite3
sqlite3 -csv -separator , 3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata "select * from message" > smshistory.csv
you can dump your SMS history to a CSV file.
I’m writing a few scripts to generate ‘top talkers’ and some other statistics, and will post those later.
12 Comments for this entry
1 Trackback or Pingback for this entry
-
Make sure to encrypt your iPhone backups | IT Security | TechRepublic.com
June 21st, 2010 on 1:35 pm[...] all set, except where to start. There are over 1000 files, so back to the Internet. I found an article by the Hampton Roads Geek community that listed exactly what I [...]

March 7th, 2010 on 4:57 am
This is a useful piece, not that hard to browse through. Thank you for spending time for you to share your your beliefs.
March 8th, 2010 on 9:23 pm
Hi,
I was curious as how you discovered the most common ones. Did you write a script that parses out the mdinfo files or did you just use trial and error with an hex editor or what? I just wanted to know a process in case these file names change.
Thanks!
March 8th, 2010 on 10:48 pm
John:
I used the ‘file’ command on the directory to single out the SQLite database files (as there are also lots of other files, such as JPGs and the like). Once I had the number of files narrowed down, I started going through each one of them with the sqlite3 command line interface tool.
May 8th, 2010 on 2:15 pm
You can also pull this data out of your iPhone backups, as made by iTunes. This is a pretty good way to get a feel for what’s on the phone. The free version of the iPhone Backup Extractor at iphonebackupextractor.com will do this.
July 27th, 2010 on 1:44 am
I wanted to get access to my calendar (2041457d5fe04d39d0ab481178355df6781e6858) and found it thanks to this PDF:
http://www.accessdata.com/downloads/media/MAC_Shortcuts.pdf
August 3rd, 2010 on 1:20 pm
Hi there, I’d really like to have a display capture via my iphone 3gs exactly like the print screen function in Windows using the keyboard. Could it be done?
September 3rd, 2010 on 11:11 pm
Hi, I am trying to retrieve data from an iPhone back up and I have the SQLite Database browser as well as the extractor. However, being new to the MAC interface, being a PC user, I have read these articles but need guidance on what goes where. Is there anyway you may help me?
September 9th, 2010 on 2:33 pm
@Uncle: press the power and home button together and it will create a screen capture image in your photo album.
August 30th, 2011 on 7:11 am
Is there a way to find deleted text messages? I know how to read the ones that are already on the phone ( 3d0d7e5fb2ce288813306e4d4636395e047a3d28) it seems pointless to search for the messages that you can read just by looking at your phone?? I deleted a message with some info on it that I needed & I’m trying to work out how to get it…some files I open in sqlite ask for an encryption key, which is weird because my phone isn’t encrypted?? if it is where do I find the key???? Would appreciate some help!
October 24th, 2011 on 5:49 am
When I backed my iPhone up, iOS 5, I get the same files but without extension.
Also when I try to open 31bb7ba8914766d4ba40d6dfb6113c8b614be442 using sqlite browser i get nothing. however, when I backup an iPhone with iOS 4 or before I can open these files.
did anyone get the same problem? how can I open these files now?
Thanks
November 1st, 2011 on 11:39 am
I’m just a dumb iPhone user wanting to backup my Contacts. You guys seem to make short work of iPhone databases. I don’t have Sql or Sql knowledge.
Any suggestions will be gratefully received.
Many thanks.
November 22nd, 2011 on 5:39 am
Is there also a file here for the FaceBook history? Will the iPhone save the pages/friends I’ve been visting (like a browser history file)?