I have just started using core data. I want to setup a pre-populated db. I read somewhere that core data creates a sqlite file when a core data app is run. I don\'t know whe
Those files are in ~/Library/Application Support/iPhone Simulator/[SDK version]/Applications/[App GUID]/Documents
for me, both for Xcode 3 and Xcode 4.
If you have multiple SDKs, make sure to look in all the different SDK version directories for your app.
Follow these steps:
In your applicationDocumentsDirectory
function in AppDelegate.swift add this code:
let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
// Look for this in the console, this will print out the location of the sqlite database, which you can then open with an SQLite viewer
print("urls.last \(urls.last)")
Look for this in the console, this will print out the location of the sqlite database, open your terminal and open whatever_the_location_path_was
Download SQLite viewer http://sqlitebrowser.org/
Right click the yourapp.sqlite file in the folder, choose Open With sqlitebrowser that you downloaded
Cheers!
For me it was in whatMuregSaid/[Application Guid]/Library/Application Support/[AppName]/filename.sqlite
hope this will help you little more
/Users/Username/ then press cmd+shift+G and write /Users/Username/Library, Now you will see Library folder after it go to Application Support/iPhone Simulator/7.1(or 7.1-64)/Applications/F84D4CC8-326E-4A2E-8A37-F1A755D6FCC4/Documents you will see three file and one is .sqlite file.
To see structure and other information of this sqlite file , the most efficient way is use SQLITE MANAGER(add on of firefox https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/) add it and then click TOOL .