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

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
I'm investigating a defect in my iOS game, the state of which is stored in an SQLite database. The bug occurs in a given state, and so I'd like my application to already be in that state when I launch it for debugging purposes.

How do I do this?
 
OK, so I think I found a way to download the SQLite database.
1) Compile and install the application, with the "Application supports iTunes file sharing" key in Info.plist created and set to "YES".
2) In Finder, click on the iPhone on the left side.
3) Click the "Files" tab.
4) Under the application's name, there will be a drop-down menu, and there will be an SQLite database file (.sqlite). Drag this file somewhere else.
5) In Terminal, navigate to the folder you put the SQLite database in.
6) Run sqlite3.
7) Run the SQLite3 command ".open (insert database file name).sqlite"

When I do this, I can see the tables and columns in the database, but SQLite3 reports that there's no data in the database. This is UNTRUE, as evidenced by the fact that I can terminate the application and restart it, and the data's all there.
 
Liya has a GUI to open a sqlite database I think. Maybe it will reveal the contents? The game could empty the state in hibernation, though unlikely. Or there is another db?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.