This question already has an answer here:
- Debugging sqlite database on the device 15 answers
I have a set of data in an SQLite database. I need to view the database on a device. How do I do that?
I have checked in ddms mode. The data in file explorer is empty.
I found very simple library stetho to browse sqlite db of app in chrome, see
Here are step-by-step instructions (mostly taken from a combination of the other answers). This works even on devices that are not rooted.
Connect your device and launch the application in debug mode.
You may want to use
adb -d shell "run-as com.yourpackge.name ls /data/data/com.yourpackge.name/databases/"
to see what the database filename is.Notice:
com.yourpackge.name
is your application package name. You can get it from the manifest file.Copy the database file from your application folder to your SD card.
adb -d shell "run-as com.yourpackge.name cat /data/data/com.yourpackge.name/databases/filename.sqlite > /sdcard/filename.sqlite"
Notice: filename.sqlite is your database name you used when you created the database
Pull the database files to your machine:
adb pull /sdcard/filename.sqlite
This will copy the database from the SD card to the place where your ADB exist.
Install Firefox SQLite Manager: https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
Open Firefox SQLite Manager (Tools->SQLite Manager) and open your database file from step 3 above.
Enjoy!
This works with Android 6.0 (debuggable apps at least):
Then you simply can view the DB with aSQLiteManager for instance.
There is TKlerx's Android SQLite browser for Eclipse, and it's fully functional alongside Android Studio. I'll recommend it, because it is immensely practical.
To install it on Device Monitor, just place the JAR file in
[Path to Android SDK folder]/sdk/tools/lib/monitor-[...]/plugins
.You can try SQLiteOnWeb. It manages your SQLite database in the browser.
Taken from here, you can try:
In build.gradle:
Initialize the library in the application object:
And you can view you database in Chrome from
chrome://inspect