Idan Aviv Idan Aviv - 1 year ago 81
iOS Question

Core Data file's Location iOS 10

I am trying to us SQLite Browsers to see my Core Data objects. I am not able to find where does the core data save its sql file. I looked into the app documents folder but there is nothing there.

Do you know where does the core data in IOS 10(simulator) save its SQLite files on?

Answer Source

I tested it on XCode 8 Swift 3 OS macOS Sierra

IOS 10

In Your Appdelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
     print(urls[urls.count-1] as URL)

    return true

1. The constant .documentDirectory says we are looking for Document directory

2. The constant .userDomainMask to restrict our search to our application's sandbox.



Click on Go -> Go to Folder -> Paste Path -> Hit Enter

enter image description here

Then Go to Library -> Application Support -> filename.sqlite

enter image description here

You can use DB Browser for SQLite to open.