Reputation: 1394
I created a sqlite3 database using terminal which has a static data. I need to add that db file into my xcode project to retrive data from it. But, I couldnt find the db file in my mac to add into my project. Where can I find my db file, so that I can add it into my Xcode. Thanks in advance :)
Upvotes: 4
Views: 22258
Reputation: 1106
Finding the default directory path:
Open terminal.
Open your database trough the command line then type '.databases', the command outputs the path of your database file right next to 'main'.
In my case the command sequence was:
sqlite3 myDBFile.sqlite
sqlite3> .databases
Output: 0 main /Users/Me/myDBFile.sqlite
Upvotes: 1
Reputation: 43
->in the search tab enter this url "~/Library/Developer/CoreSimulator/Devices/"
-> find the latest device by the date modified and go further in the file explorer to /data/Containers/Data/Application/(APPLICATION_ID)/Documents/(databaseName).sqlite
Upvotes: 2
Reputation: 76
My sqlite database is located here: Library/Application Support/iPhone Simulator/skd version(i.e. 5.1)/Applications/a bunch of numbers and letters/Documents/yourdatabase
Upvotes: 5