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
I figured it out. I had to chmod the databases folder as well and then the file.
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.
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.
I using these commands to get data from /data/data folders, no changing permission required