Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kaius

macrumors newbie
Original poster
Apr 8, 2008
13
0
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.
 

lucasgladding

macrumors 6502
Feb 16, 2007
319
1
Waterloo, Ontario
2) Any ideas on how we GET the file/data OUT of the iPhone and onto the desktop or elsewhere for data analysis?

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.
 

kaius

macrumors newbie
Original poster
Apr 8, 2008
13
0
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.
 

kaius

macrumors newbie
Original poster
Apr 8, 2008
13
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.