Antol
Antol

Reputation: 103

Locating Core Data’s sqlite database on Mac OS X app

Where I can find Core Data’s sqlite database of Mac OS X application?

I have found it, but it's *.momd folder with 3 files (VersionInfo.plist, *.mom *.omo). How can I see the contents of it?

Upvotes: 6

Views: 6857

Answers (5)

Kaunteya
Kaunteya

Reputation: 3090

I have noticed it getting stored in /Users/<username>/Library/Containers/<appbundleid>/Data/Library/Application%20Support/<AppName>/<DataModel>.sqlite

So in my case following was the path of the test app /Users/kaunteya.s/Library/Containers/com.kaunteya.T1/Data/Library/Application%20Support/T1/T2.sqlite

Upvotes: 1

Heo Đất Hades
Heo Đất Hades

Reputation: 1633

In High Sierra, SQLite file is saved in ~/Library/Application Support/[YourAppName]

Upvotes: 1

Andrew
Andrew

Reputation: 7719

On OS X 10.7 Lion when the app is sandboxed, it is stored in:

~/Library/Containers/com.yourcompany.yourAppName/

Upvotes: 7

codeclash
codeclash

Reputation: 2063

You can find the sqlite file under ~/Library/Application Support/iPhone Simulator/[SDK version]/Applications/[App GUID]/Documents

To inspect the contents of the database file, you could use this firefox extension: Sqlite-manager

Upvotes: -3

Rob Napier
Rob Napier

Reputation: 299623

The persistent store in Core Data is just a file. So it's most likely in your Documents directory if it's a user's document. If it's an internal store, then it may be in the bundle, or may be put somewhere like ~/Library/Application Support.

Upvotes: 2

Related Questions