views:

176

answers:

1

I have a sqlite DB that has a lot of test data inside. Currently, I load the data inside the app code, but take several minutes inside the iPod I use for testing.

I wonder if is possible to make in Xcode a pre-build tests that inits the db, then adds it to the app bundle, so I can extract it from the iPod.

I'm stuck in how create & pre-populate the db..

+1  A: 

Use a scripting language like Ruby or Python to load the database from source (or extract the Objective-C code out and use that. I'm just thinking speed of development here).

Then create a new Build Phase (a Run Script build phase) and run this script when you do a build, so you end up with a db.

Then, create a Build Phase, a Copy Files build phase that happens after the one you created above, to copy the db to the app bundle.

RyanWilcox
For that matter you can write a command-line tool to build your database, have one target in your project that compiles that app, then your Run Script build phase in your app target can just execute it, directing its output right into your app's Resources folder.
cdespinosa