I have a rooted phone and running adb in root mode.
I used adb shell to successfully access the phone.
I can browse directorys, even those who require root.
When i try to use:
adb pull /data/data/my.app.path/databases/mydatabase.db /home/admin/Desktop/
I get the following error:
error: device not found
The adb shell stays connected and i can go on browsing the sdcard.
Can anyone tell me where this error comes from and how i can fix it to pull the file?
Failed ADB connections usually have one root cause: bad Android USB drivers that load in place of the right ones. Windows doesn't make it easy to remove the wrong drivers, unfortunately. But before attempting to troubleshoot an ADB connection, first enable USB debugging on your phone if it's not on already.
Stay out of shell during adb pull
.
Seems that nobody provided an explanation yet.
The error has no relation to adb running as root. Running adb pull
from inside a shell in Android expects an Android device (running adb server) connected to primary Android device as slave, which of course doesn't exist, and so comes the error.
However, you can run that command successfully from inside an Android, if you connect your primary Android device via OTG to another device and that one starts charging (becomes a slave). In that way, you can in fact do adb shell
from inside your primary Android.
Otherwise, you can run ADB on your device or the other device in TCP mode and do adb connect <IP:PORT>
from inside the primary device's shell to connect to localhost or the other device's shell.
Even then, your command adb pull /data/data/my.app.path/databases/mydatabase.db /home/admin/Desktop/
is bound to fail because there is no /home
directory concept in Android and so, the destination simply doesn't exist in Android.
Though you already know, you've to come back to your PC's shell so that your primary device can be treated as a slave or a server, and your command would run successfully (readers: root is required for this command to work).
You can try:
adb wait-for-device pull /data/data/my.app.path/databases/mydatabase.db
/home/admin/Desktop/
This way adb
will wait for your device to be connected. It may help but I am not sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With