Reading a database file from an Android device

I tried to get a copy of my sqlite database from my android app for dev. My first attempt was to call:

./adb shell
cd data/data
cd com.example.app
cd databases

But then I was stuck here, because I do not have permission to make pullor even view files in this directory!

So, I thought I'd try using DDMS File Explorer, which gives me this: File explorer

But when I try to pull the files here (I would expect them to be in the data folder), it just pulls out the directory and nothing else. How can I do this to pull out a copy of the database that my application creates / uses?

I tried this when the phone is on the SD card and in the phone’s memory. I think I could copy it to an SD card and then connect the SD card to a PC, not a phone, and do that? Not sure if this will work and will be very annoying to be that way!

thank

+3
source share
2 answers

IF you just need a database for general checking / viewing, you can run your application on an emulator and get a database there. If you need a specific instance on your device, you need to hack it, as others suggest.

+1
source

If your device does not give you access to this directory (and your device is not deployed - if you become the root user, you will have access), you will need help from your application.

, , databases/your_database_name.db , , SD-. .

+2

All Articles