Where is SQLite database stored on iOS device?

39 views
Skip to first unread message

Kerry Fang

unread,
May 3, 2016, 2:13:54 AM5/3/16
to phonegap
I am building an app for my phd project, and I'm going to do a trial on a number of people. Will be giving them each an iPad to bring home for a few weeks which will help to store their medication adherence (so I will store the date and time, and the medication names etc through a series of button clicks and checkboxes into the database). The problem is how do I view the data stored in each device? I know how to view them when running on a simulator on xcode, but not sure how to view each of them when I get the iPads back. I won't be letting the users view these data themselves so I can't display the current database on the iPad screen. And each users are taking different medication at different times too. So just wondering how to view each of them when I connect each iPads to my MacBook or through the iPad itself? Thanks in advance

Steve Husting

unread,
May 3, 2016, 11:05:40 AM5/3/16
to phonegap
Generally, when you make a database, you also make a page that contains a script to pull the records and display them. If you don't want the user to view the data, then create a sign-in page where only you know the name a password to open.

In my experiment, I included code to enter information into the in-app WebSQL database, and a page with buttons and fields to display the information entered: https://iphonedevlog.wordpress.com/2014/03/21/cordova-websql-database-with-user-added-data/

Kerri Shotts

unread,
May 3, 2016, 2:05:05 PM5/3/16
to phonegap
Another option (since your users don't need to see the data):

If you're using a SQLite plugin, the file will be easily accessible in the app's /Documents folder. If you're using Web SQL, it's buried somewhere in the /Library folder, but given that Web SQL itself is limited in storage space, I'd highly suggest using a SQLite plugin instead.

In order to get access to those folders, you can use a tool like iExplorer to see the directory contents. You can also enable iTunes File Sharing and get at data in that way as well.

On Tuesday, May 3, 2016 at 1:13:54 AM UTC-5, Kerry Fang wrote:
...
Reply all
Reply to author
Forward
0 new messages