Reputation: 1
My app uses an sqflite .db file that is populated after installation. What I want to do is get that populated file, put in assets and edit my app to use the .db file from assets. This would greatly help my app, as it takes a lot of time to populate the list (it does so from an online database). I use Android Studio to develop and my phone to test the app via USB Debugging. The debug version's installed, I can't seem to find the app folder in Android/data. I NEED to get that .db file, so help?
Upvotes: 0
Views: 2173
Reputation: 6239
The default location of your application database on Android should be:
/data/data/<package-name>/databases/<db-name>
You should be able to locate that file using Device File Explorer in Android Studio. (notice it is /data/data
, not just /data
)
Once you locate that file, you can extract easily any file from Android emulator using adb pull
in a script. adb
is in the platform-tools
folder of your Android SDK. Assuming adb
is in your PATH, you can do:
adb root
adb -e pull /data/data/<package-name>/databases/<db-name> <local-destination-path>
Upvotes: 1