Skip to content

Instantly share code, notes, and snippets.

@jimbrayrcp
Last active April 14, 2022 21:14
Show Gist options
  • Save jimbrayrcp/48b446f4f791094c5f7135b9d734e51c to your computer and use it in GitHub Desktop.
Save jimbrayrcp/48b446f4f791094c5f7135b9d734e51c to your computer and use it in GitHub Desktop.
Find the sql lite file path attached to a core data project. Open with SqlLiteBrowser downloaded from https://sqlitebrowser.org/. You will find the file within the folder path given just inside of the folder labeled with /YOUR-PROJECT-NAME/. ~ and. ~ then find the DB labeled YourProjectName.sqlite
func whereIsMySQLite() {
let path = FileManager
.default
.urls(for: .applicationSupportDirectory, in: .userDomainMask)
.last?
.absoluteString
.replacingOccurrences(of: "file://", with: "")
.removingPercentEncoding
print(path ?? "Not found")
}
CALL WITH:
whereIsMySQLite()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment