adb pull -> device not found

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.


Stay out of shell during adb pull.