HR Geeks

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.


4 Comments for this entry

  • Yoko Mandoza

    This is a useful piece, not that hard to browse through. Thank you for spending time for you to share your your beliefs.

  • John Wright

    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!

  • adam

    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.

  • Aidan Fitzpatrick

    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.

1 Trackback or Pingback for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!