Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adb pull -> device not found

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?

like image 933
Ostkontentitan Avatar asked Dec 03 '13 09:12

Ostkontentitan


People also ask

Why is adb not working?

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.


3 Answers

Stay out of shell during adb pull.

like image 176
Viswanath Lekshmanan Avatar answered Sep 22 '22 13:09

Viswanath Lekshmanan


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

like image 45
Firelord Avatar answered Sep 21 '22 13:09

Firelord


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.

like image 43
jmlemetayer Avatar answered Sep 22 '22 13:09

jmlemetayer