Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
962 views
in Technique[技术] by (71.8m points)

database - Android Eclipse DDMS - Can't pull file from rooted device

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.

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)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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) 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...