Ionic – How to Access or Browse SQLite Database

1

The blog represents instructions on how could you access or browse SQLite database embedded in your android app. The way that works for me is to copy the database on to my system and access the same.

Make sure you connected your mobile phone to your laptop/desktop. Check with command “adb devices” to see that your device (phone) is listed. 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 following command to copy the database file to current directory

adb pull /sdcard/database_name .

With above command, you should be able to find the database copied in current directory.

Use SQLite browser to open the database and browse the data.

That is it!

Ajitesh Kumar

Ajitesh Kumar

Ajitesh is passionate about various different technologies including programming languages such as Java/JEE, Javascript, PHP, C/C++, mobile programming languages etc, and, computing fundamentals related with cloud-native technologies, application security, cloud computing platforms, mobile apps, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Latest posts by Ajitesh Kumar (see all)

1 Comment

  1. Pingback: Android - ADB Shell Batch Scripting - Automate SQLite Database Copy - Bytes Cravings

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.