I've created an app that uses core data. Is there a way to view the sqlite db on the simulator? A tool perhaps that allows to query the sqlite db on the simulator? Like a data browser?
Is there a way to browse the iphone simulator to the sqlite db location?
Open Xcode and create a new project by choosing the Single View App template form the iOS > Application section. Name the project Notes and check Use Core Data at the bottom. Open AppDelegate.
Core Data is a framework that you use to manage the model layer objects in your application. It provides generalized and automated solutions to common tasks associated with object life cycle and object graph management, including persistence.
The next time you need to store data, you should have a better idea of your options. Core Data is unnecessary for random pieces of unrelated data, but it's a perfect fit for a large, relational data set. The defaults system is ideal for small, random pieces of unrelated data, such as settings or the user's preferences.
Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it. LaunchBar, which is my launcher of choice, also ignores aliases, so dragging Simulator.
With Xcode 6, the simulator base directory can be found here:
~/Library/Developer/CoreSimulator/Devices/<device-id>/data/Containers/Data/Application
Then, the database itself can be found in the documents directory:
<app-id>/Documents/<name>.sqlite
The database can be accessed using sqlite3
on the command line.
I just downloaded a trial of Base and was able to point it at the .sql database from the simulator via:
/Macintosh HD/Users/"username"/Library/Application Support/iPhone Simulator/"current iOS development version"/Applications/
The folder names for the applications are unreadable, but if you click on the folder you should be able to see the contents with familiar names.
This was changed in Xcode 6, and now is located at ~/Library/Developer/CoreSimulator/Devices/<device-id>/data/Containers/Data/Applaction
where the database itself can be found within the documents directory <app-id>/Documents/<name>.sqlite
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