SQLite

Discussion in 'Mac Programming' started by kaius, May 9, 2008.

  1. kaius macrumors newbie

    Joined:
    Apr 8, 2008
    #1
    Has anybody here been working with SQLite and the iPhone?

    It seems rather straight forward, except:

    1) Is there an easy way to be able to work with the DB file either on the iPhone or the simulator to see whether what one is doing with code is actually reflected in the file?
    2) Any ideas on how we GET the file/data OUT of the iPhone and onto the desktop or elsewhere for data analysis?

    Thanks.
     
  2. lucasgladding macrumors 6502

    Joined:
    Feb 16, 2007
    Location:
    Waterloo, Ontario
    #2
    Seconded. I have hopes that we will see some form of synchronization in the next version or two of the SDK. I recall reading that iPhone applications will be backed up to your desktop system. If that is the case, you can at least pull the support documents from there manually.

    To see the SQL document for most applications, go to the application in your project build folder and choose Show Package Contents. I think the simulator saves support documents there. I haven't written to the filesystem in my own app yet, so please correct me if this doesn't give you the file you want.
     
  3. kaius thread starter macrumors newbie

    Joined:
    Apr 8, 2008
    #3
    Hi Lucas,

    You're back! I am trying to save my oscilloscope data now...

    I could not find how to "show package contents" in the iPhone SQLiteBooks Demo project. Can you guide me on this one?

    Thanks.
     
  4. kaius thread starter macrumors newbie

    Joined:
    Apr 8, 2008
    #4
    Here's the answer!

    You can access the live simulator documents directory, so if you type this in the terminal:

    sqlite3 ~/Library/Application Support/iPhone Simulator/User/Applications/<your app GUID>/Documents/<yourdatabase>.sqlite

    you will be able to interactively query the database as your app is running.
     

Share This Page