How automate sqlite db creation in Xcode and put it in the app bundle
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 i开发者_开发知识库s 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..
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.
精彩评论