Where is the sqlite3 database stored on the iphone emulator?
Now that I have a read-only application working, I am working on the insert statement. The insert returned OK in my code, but the read-back (in the code) came up empty, so I want to use the command line or browser to read. Can I copy the DB off the em开发者_高级运维ulator and into my laptop for access with other utilities?
You can access the documents directory of your app at ~/Library/Application Support/iPhone Simulator/<SDK VERSION>/Applications/<SOME RANDOM HASH>/Documents
Note that the SDK version will be different depending on what you are building under, and the hash is tough to figure out which one is yours. Just inspect the folders and look for a YOURAPP.app
binary to figure it out.
What database?
Assuming you have created it in your app's documents folder, app sandboxes for the simulator are in ~/Library/Application Support/iPhone Simulator/<version>/<uuid>
, and contain the application and it's Documents, Library and tmp directories.
精彩评论