How to find a database file on an Android virtual device?

My plan is to pre-create the database on a virtual device, and then include the database in the distribution of my application.

However, I cannot find the database file.

Is there anything on my hard drive? How to get it?

I tried connecting with adb, I made "ls" and then really got scared of this obscure directory listing:

sqlite_stmt_journals
cache
sdcard
etc
system
sys
sbin
proc
init.rc
init.goldfish.rc
init
default.prop
data
root
dev

Even when I went to /data/data/your.package.here/databases, I still do not have access to the actual database file. I can not use sqlite3 or pull it. Is there a way to change permissions?

This works fine on my emulator, but does not work on the adb pull / data / data // databases / mydb.db device itself.

+3
3

/data/data/your.package.here/databases, your.package.here , , AndroidManifest.xml.

+4

( /data/data/your.package.here/databases), , root . "su" . root, , .

+1

The blog post below gives a good decision on how to find and access your database. The post talks about using busybox, which provides useful command line utilities to find your database and gives some useful examples of how to use sqlite3 to access databases and tables.

http://davanum.wordpress.com/2007/12/11/android-how-to-poke-around-the-sqlite3-databases/

+1
source

Source: https://habr.com/ru/post/1711222/


All Articles