How to view the data which is present in the sqlite file in an application running in iphone , like we use mysql work bench to view the contents of the database
-
1[The Library folder was hidden - this answer helped me][1] [1]: http://stackoverflow.com/questions/11761695/where-does-the-iphone-simulator-save-the-sqllite-database – Bob Mar 22 '14 at 08:40
-
Use command `find /Users/
/Library/Developer/CoreSimulator/Devices/ -name "*.db" -printf "%T+\t%p\n" | sort` to find the latest modified db file – user10375 Oct 10 '19 at 00:27
8 Answers
If you want to view your database when running on Simulator it is located at the following location
user/Library/Application Support/iPhone Simulator/version of SDK(4.2eg)/Applications/4AF938D6-E981-4971-A588-3424B64E7EE7(eg)/Documents/yourdatabase.sqlite
If you want to view the database in your device then you can use a software like iExplorer
.
Cheers
Edit : The location of sqlite file has changed.
It currently resides in :
/User/Library/Application Support/iPhone Simulator/version of SDK(eg-7.0)/Applications/4AF938D6-E981-4971-A588-3424B64E7EE7(eg)/Library/Application Support/app_name/yourdatabase.sqlite
Edit : The location has changed again. It now resides in:
/User/Library/Developer/CoreSimulator/Devices/789A1317-6C55-4615-A72E-65C824D8C6B9(eg)/data/Containers/Data/Application/0470F5FC-0043-46B7-A21C-A436A56ED714(eg)/Documents/yourdatabase.extension
-
@Manishh is it changed again as I cannot see CoreSimulator folder in Developer one? – Shubham Ojha Aug 17 '19 at 10:22
-
2It changed again, for me it is /System/Volumes/Data/Users/`User`/Library/Developer/CoreSimulator/Devices/*/data/Containers/Data/Application/*/Library/LocalDatabase/ – Edson Horacio Junior Nov 30 '19 at 00:51
-
yourdatabasename.extension (example: basedb.sqlite3) doesn't exist – Kuvonchbek Yakubov Dec 08 '19 at 17:24
-
For me it was /System/Volumes/Data/Users/User/Library/Developer/CoreSimulator/Devices/*/data/Containers/Data/Application/*/Library/Application Support/ – Jalil Jun 05 '23 at 18:20
If you want to see data base while app is running in simulator
- Open finder
- open
Go
intoolbar
- Then Press and hold command+option you can see Library option
then process like this
Library/Developer/CoreSimulator/Devices/8FA9F307-45DC-48EC-89ED-E4BDC34CB628/data/Containers/Data/Application/B6105584-49BF-4C0C-BC72-C97FA9B1C194/Documents/database.db

- 1,444
- 13
- 23

- 81
- 1
- 4
The Firefox extension SQLite Manager is good and free. Another good, free Mac option is SQLite Database Browser.

- 22,245
- 10
- 71
- 97
Grabbing a database in live mode (meaning an apps-live-database on an iphone) you can use the iExplorer for downloading the .sqlite file to your computer and explore it with e.g. MesaSQLite!
Thank you so much for pointing me into the right direction here!

- 1
- 1

- 4,114
- 2
- 18
- 13
These locations depend on the device you're using in the simulator, so it makes no sense to copy a specific folder as the answer...
The more general answer about how to figure out the path to the actual database file:
- On the dock, right click on Finder, select Go To Folder
- Paste in the following, and click Go:
~/Library/Developer/CoreSimulator/Devices
- On the top right corner of the Finder window search for the database name you are looking for, then make sure the Search location is set to "Devices" folder, not the whole "This Mac".
- The db file will show up and if you select it, it will give you the full path! To browse the database content I use this tool: sqlitebrowser

- 3,421
- 29
- 46
If you're comfortable using Xcode plugins, NCSimulatorPlugin makes it trivial to jump right to your app from Xcode.
Instead of choosing Go To Documents as shown above, choose Go To Application.
Ctrl-click on the app and choose Show Package Contents.
Done!

- 5,118
- 5
- 41
- 54
The solutions involving simulator do work but sometimes you needed to explore the database on a physical device.
If you want to view your sqlite database when running on a device connected to your Mac you'll first need to mount the application files on your mac. You can use iExplorer for that. There is a free demo I used for testing but paid $40 in end: iexplorer website
Once you mount the apps files you can explore the database using DB browser for sqlite: DB browser for sqlite website. Its not as polished as mysql workbench but its free and gets the job done.

- 1,549
- 4
- 24
- 35
The location of sqlite file (Simulator):
/Users/myUser/Library/Developer/CoreSimulator/Devices/032D9DFB-FBD4-4204-B137-945F1A02FDED(eg)/data/Containers/Data/Application/C10BDAF7-25E2-42CC-A1BE-C5CC04C7567D(eg)**/Library/LocalDatabase**
I use the DB Browser for SQLite to view the database: http://sqlitebrowser.org/

- 11,718
- 21
- 43
- 52

- 9
- 1