I am facing problem in accessing database file when I am running it on device. How can I get that file? There is no problem in accessing file when I am running application on simulator. Like when I am running application on simulator DB file is in :
/Users/Nitish/Library/Application Support/iPhone Simulator/4.3/Applications/1B787527-0608-4BC1-8022-DFDB3CC35F66/mysqlite.sqlite
Where will I find the DB file when application is running on device?
Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.
Open an Access database from Windows ExplorerIn Windows Explorer, navigate to the drive or folder containing the Access database file you want to open and double-click the database. Access starts and the database is opened.
Reading all comments and answer, I think nobody actually answered simple question of the author:
How to access sqlite database file while runs on the actual device (it's not an issue in iPhone simulator as author indicated)
Here is what I do:
(once!) Make sure all hidden files are visible on your Mac: In terminal window run: defaults write com.apple.Finder AppleShowAllFiles YES
While in Xcode, open Organizer -> Devices, find your iPhone and from their find your application in Applications folder.
At the bottom click Download and download the application to your desktop (anywhere)
Open Finder, navigate to the downloaded file, right click on it and select Show Package Contents. The view will change to standard finder view with open files in that app.
Go to the Documents folder, find your *.sqlite file, right click on it and choose Open With -> Other
Select SQLite Database Browser (http://sqlitebrowser.sourceforge.net) and enjoy view of your database through database browser.
It takes less than a minute to run the whole process, once you do it once.
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