Cannot adb pull database even after chmod 777 on m

2019-04-07 03:31发布

I am unable to pull a the database from the device even after changing the permission. I have a rooted phone. It used to work. I could pull before. For some unknown reason now I cannot.

The error I receive is remote object '/data/data/com.thuptencho.transitbus/databases/ttc.db' does not exist

Does anybody know why this is happening? Below is what I did in command window.

C:\users\thupten>adb shell
shell@android:/ $ su
su
root@android:/ # cd /data/data/com.thuptencho.transitbus/databases/
cd /data/data/com.thuptencho.transitbus/databases/
root@android:/data/data/com.thuptencho.transitbus/databases # ls
ls
ttc.db
ttc.db-journal
webview.db
webview.db-journal
webviewCookiesChromium.db
webviewCookiesChromiumPrivate.db
root@android:/data/data/com.thuptencho.transitbus/databases # chmod 755 ttc.db
5 ttc.db                                                                      <
root@android:/data/data/com.thuptencho.transitbus/databases # chmod 777 ttc.db
7 ttc.db                                                                      <
root@android:/data/data/com.thuptencho.transitbus/databases # exit
exit
shell@android:/ $ exit
exit

C:\users\thupten>adb pull /data/data/com.thuptencho.transitbus/databases/ttc.db
remote object '/data/data/com.thuptencho.transitbus/databases/ttc.db' does not exist

标签: android adb
5条回答
Ridiculous、
2楼-- · 2019-04-07 03:38

I figured it out. I had to chmod the databases folder as well and then the file.

查看更多
欢心
3楼-- · 2019-04-07 03:42
for i in `adb shell ls /data/ -1`;do adb pull /data/$i data; done
查看更多
祖国的老花朵
4楼-- · 2019-04-07 03:43

The problem is that you need permission not just to the file, but also to its parent directories.

(That permission should not be 777 though!)

Rather than trying to change the permission, what you probably want to do is get adb running as root if that is supported, (ie, if you have an engineering build, rather than an aftermarket "rooting" of a secured device) or else use your root access (or the app itself, or the stock run-as command if you have a debug apk) to copy the file of interest somewhere accessible and then adb pull the copy.

查看更多
对你真心纯属浪费
5楼-- · 2019-04-07 03:52

My preferred solution was:

Install Chainfire's adbd insecure app From within the adbd insecure app, select "Enable Insecure adbd" adb pull /data/data/com.package.name/databases/database.db

Caution - adb insecure means adb is running as root on your device.

查看更多
Evening l夕情丶
6楼-- · 2019-04-07 03:55

I using these commands to get data from /data/data folders, no changing permission required

adb kill-server
adb root
查看更多
登录 后发表回答