Android的Eclipse的DDMS - 无法从拉根设备文件文件、设备、Android、Eclipse

2023-09-04 07:39:20 作者:输给了曾经  □Ever

我正在测试一个根深蒂固的Nexus S手机我的应用程序。我终于有了从this回答。

I am testing my app on a rooted Nexus S phone. I finally have access to the /data/data folder thanks to some awesome help from this answer.

问题是,当我尝试使用DDMS从设备拉文件,我得到这个错误:

Problem is when I try to use DDMS to "pull a file from the device" I get this error:

[2012-03-20 18:15:26] Failed to pull selection
[2012-03-20 18:15:26] (null)

任何人都知道如何把数据库的副本,这样我就可以看它在一个SQLite编辑器?

Anyone know how to pull a copy of the database so I can look at it in a SQLite editor?

推荐答案

我发现拉实际的数据库文件(my_database.db),你必须在亚行外壳使用chmod上特定文件。所以,你需要明确定义您要访问数据库的路径。

I found out that to pull the actual database file (my_database.db) you have to use chmod on that specific file in the adb shell. So you need to explicitly define the path to the database you want to access.

例如,如果数据库文件是my_database.db和应用程序包的com.example.database,你就需要调用以下内容:

For example, if the database file were my_database.db and the application package was com.example.database, you would need to call the following:

1)在cmd中输入:ADB壳 2)类型:苏 3)preSS允许的根手机 4)在cmd中键入:chmod 777 /data/data/com.example.database/databases/my_database.db 5)转至DDMS在Eclipse 6)导航到my_database.db文件并选择它 7)选择拉从设备的文件,然后选择保存位置

1) In cmd type: adb shell 2) Type: su 3) Press "allow" on the rooted phone 4) In cmd type: chmod 777 /data/data/com.example.database/databases/my_database.db 5) Go to DDMS in Eclipse 6) Navigate to the my_database.db file and select it 7) Choose "pull a file from the device" and choose where to save it