iPhone 5.0 Simulator contacts database

Discussion in 'iOS Programming' started by saqibjaan, Jul 2, 2012.

  1. saqibjaan, Jul 2, 2012
    Last edited: Jul 2, 2012

    saqibjaan macrumors member

    Joined:
    Feb 1, 2012
    Location:
    Lahore
    #1
    I have added 200 contacts in Simulator using Objective-C. Now, I want to access contacts database file (SQLite file). What is the path of that file ? I am developing for jailbreak iPhone.

    Thanks in advance.
     
  2. CodeBreaker macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #2
    The sqlite db is here:

    /Users/username/Library/Application Support/iPhone Simulator/5.1/Library/AddressBook/AddressBook.sqlitedb
     
  3. saqibjaan thread starter macrumors member

    Joined:
    Feb 1, 2012
    Location:
    Lahore
    #3
    Thanks for your reply.
    But when I try to open AddressBook.sqlitedb file, following error occurred:

    "SQL error: file is encrypted or is not a database"

    I am trying to open the file in MAC terminal using
    "sqlite3 AddressBook.sqlitedb" command.
     
  4. CodeBreaker macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #4
    That's strange. I just tried it and it is able to open up the database for me. Are you accessing it from your own user library? Can you check and post the file permissions for AddressBook.sqlitedb?
     
  5. saqibjaan thread starter macrumors member

    Joined:
    Feb 1, 2012
    Location:
    Lahore
    #5
    I have solved the problem by using ABAddressBook framework.

    Thanks everyone for valuable comments and answers.
     

Share This Page