在Android设备访问SQLite数据库 [英] Access sqlite database on android device
问题描述
我想访问设备上的SQLite数据库文件。我的意思是,我已经通过亚洲开发银行发起了设备上的应用程序。现在我wanto下载此文件,因为我通过DDMS之前做了仿真器。但是,当我选择在DDMS的设备并打开该文件夹中的数据,它是空的。
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.
感谢。
推荐答案
您可以访问到数据文件夹中的无根,所提供的应用程序可调试
You can access to the data folder without root, provided the application is debuggable
<application
...
android:debuggable="true"
...
要列出基本目录:
adb shell "run-as com.your.package ls -l"
要复制的文件:
adb shell "run-as com.your.package cat relative/path > /sdcard/some_name"
adb pull /sdcard/some_name
不幸的是pre-ICS 运行方式
是相当马车。通常的症状是
Unfortunately pre-ICS run-as
is quite buggy. The usual symptom is a
run-as: Package 'com.your.package' is unknown
消息。
这篇关于在Android设备访问SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!