I created an iPad app on xCode(using PhoneGap) with sqlite plugin, stored data, and then when I want to view the data I stored I couldn't find where I saved it. According to my online research, it should be under /Library/Developer/CoreSimulator/Device
However when I navigate to the /CoreSimulator file, I don't see a sub-folder "/Device", just "/Profiles/Runtimes"?
When I reopen the app and wanted to check my stored data I couldn't see them aswell.
The database that can be used by apps in iOS (and also used by iOS) is called SQLite, and it's a relational database. It is contained in a C-library that is embedded to the app that is about to use it. Note that it does not consist of a separate service or daemon running on the background and attached to the app.
The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.
Xcode 10.1 In the Devices tab, select your application, then click on the Gear icon, then click Download Container... Choose the location you want to save the file, then click on Save. I recommend downloading DB Browser for SQL File, and opening the . sql file with that.
Xcode 9.1: Open Finder, press Shift + Command + G, paste the path and press Go. Use DB Browser for SQLite to view the . sqlite file.
let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let docsDir = dirPaths[0]
print(docsDir)
Get the path printed in the debugger, copy it, open finder and press Cmd+Shift+G. A dialog box of Go to folder will open and paste the path and hit enter. You will be navigated to that folder. All the documents created in your project will be present in that folder including the .sqlite file. Don't try to navigate to that folder manually. Chances are you are looking at the wrong folder.
Also don't worry when every time Xcode prints a different path. Its a change brought from Xcode 6 onwards. Don't know why. But your files(those documents) will probably stay updated.
This is My app's folder:
/Users/***/Library/Developer/CoreSimulator/Devices/4420949E-AD14-4A4F-9153-53891734BEB9/data/Containers/Data/Application/0A18183F-2CF6-4D72-938D-DF59CFA48CCF
you can find your app's folder by the following code:
NSString *strPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
Or just add a plugin: NCSimulatorPlugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With