What's fastest way to re-test iPhone core data migration to a new version?
That is, how would one set up an easy/quick way to:
- set up older version of app on simulator
- run the new version of the app from Xcode which will as part of running it开发者_JAVA百科 on the simulator effectively run the migration
BACKGROUND- haven't had to do a migration yet. It's not to me in Xcode how to do the first bullet in particular. Would one use a previous image/snapshot as part of the approach?
What I always did is:
- navigate to your applications folder
/Users/username/Library/Application Support/iPhone Simulator/4.3.2/
notice the iOS version number, its the one you're using in the simulator - there should be one or more folders with hash values, found the one you're working with
- in the documents folder should be your
.sqlite
database file (as long as you haven't changed the directory in code) - backup that one (for example version 1)
- when you want to test the migration, simply replace this db file with your backup
(the hash may change when you delete and rebuild your app)
精彩评论