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 downl开发者_如何学JAVAoad 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.
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.
Have you tried adb
directly?
adb pull /data/data/the.package.of.the.app/databases/the_name_of_the_database.db
精彩评论