Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access sqlite database on android device [duplicate]

Tags:

android

sqlite

I'm trying to access the sqlite database file on the device. I mean, I've launched the app on the device via adb. And now I wanto to download this file as I did before on emulator via DDMS. But when I select the device on DDMS and open the folder data, it is empty.

Is it the right way to do? Or there is another way to download this db file.

Thanks.

like image 361
rogcg Avatar asked Jan 31 '11 21:01

rogcg


1 Answers

You can access to the data folder without root, provided the application is debuggable

<application
 ...
        android:debuggable="true"
 ...

To list the base directory :

adb shell "run-as com.your.package ls -l"

To copy a file :

adb shell "run-as com.your.package cat relative/path > /sdcard/some_name"
adb pull /sdcard/some_name

Unfortunately pre-ICS run-as is quite buggy. The usual symptom is a

run-as: Package 'com.your.package' is unknown

message.

like image 141
bwt Avatar answered Oct 12 '22 23:10

bwt