nOOb iOS
nOOb iOS

Reputation: 1394

Where can I find my sqlite3 database file in my mac?

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

Answers (4)

Nikolay
Nikolay

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

Andrew Owen Ssembatya
Andrew Owen Ssembatya

Reputation: 43

  • ->Go to your Desktop(i.e click on the desktop)
  • ->press (shift)+(cmd)+(G) a search tab should open up
  • ->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

Hans Kruse
Hans Kruse

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

Aleks
Aleks

Reputation: 410

Maybe you could look at this thread, but I'm not sure that is what you want : here

Upvotes: 0

Related Questions