Ionic: How to Access or Browse SQLite Database
The article has instructions on how you can access or browse SQLite database embedded in your android app.
Join the DZone community and get the full member experience.
Join For FreeThe article has instructions on how you can access or browse SQLite database embedded in your android app. The way that works for me is to copy the database onto my system and access the same.
Make sure you have connected your mobile phone to your laptop/desktop. Check with command “adb devices” to see that your device (phone) is listed.
The following commands can be used to get the Cordova SQLite database on your hard disk filesystem:
- adb shell
- run-as package-name-of-the-app
- chmod 666 databases/database_name
- exit
- cp /data/data/package-name-of-app/databases/database_name /sdcard/
- run-as package-name-of-the-app
- chmod 600 databases/database_name
- exit; exit
Once you are on system command prompt, execute the following command to copy the database file to current directory:
adb pull /sdcard/database_name
With the above command, you should be able to find the database copied in the current directory.
Use SQLite browser to open the database and browse the data.
That is it!
Published at DZone with permission of Ajitesh Kumar, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments