Seraphim's
Seraphim's

Reputation: 12768

Android: adb.exe pull /mnt/sdcard/somefile.txt not working?

Maybe I'm doing something wrong. I'm trying to get a file from my device with adb command:

adb pull /mnt/sdcard/deviceinfo.dat C:\

but I always get the message:

cannot create 'c:\\deviceinfo.dat': No such file or directory

The file esists on device:

adb shell ls /mnt/sdcard/deviceinfo.dat

returns

/mnt/extsd/deviceinfo.dat

I've tryed with some variants:

adb pull /mnt/sdcard/deviceinfo.dat
adb pull /mnt/sdcard/deviceinfo.dat C:\
adb pull /mnt/sdcard/deviceinfo.dat C:\deviceinfo.dat

but I always get the same error. Where is the problem for pull? I'm running cmd.exe as Administrator.

Upvotes: 13

Views: 25486

Answers (5)

Maximilian Bienhuels
Maximilian Bienhuels

Reputation: 11

Make sure the files/subfolders contains no illegal characters. In my case there were files and folders with : in their names.

Upvotes: 1

yanzi1225627
yanzi1225627

Reputation: 963

I solve the same prolem by create a folder in your destination path. For example, adb pull /sdcard/a.txt D:\ you will get the error. Create a temp folder in D:\, and then use adb pull /sdcard/a.txt D:\temp, everything is ok! This problem was found in adb 1.0.36 version.

Upvotes: 5

Gabriël
Gabriël

Reputation: 1315

It can also be that the file alread exists on location to which you want to pull it and is in use or write protected and therefore can't be overwritten.

Upvotes: 0

Seraphim's
Seraphim's

Reputation: 12768

I'll answer to my own question after some hours of pain...

cmd.exe was launched with the mouse using context menu option "Run as administrator" but unfortunatelly commands fail because, for some reason, adb.exe can't write local file. So the error: cannot create 'c:\\deviceinfo.dat' ...

Now the correct steps:

1 - Windows key (focus on search textbox)
2 - Type cmd.exe (it find cmd.exe obviously)
3 - CTRL+SHIFT+ENTER (to run as Administrator)
4 - adb shell ls /mnt/sdcard/deviceinfo.dat (works fine now!)

I don't understand why using "Run as Administrator" on the context menu (after right click on command prompt icon on my Win7 bar) doesn't work as expected.

Upvotes: 16

Zamani
Zamani

Reputation: 304

you need to check each and every file u passing is valid like :

--in your command cmd.

--cd c: press enter

--cd mnt press enter.

--cd sdcard press enter.

--deviceinfo.dat

then you will be able to get what you want.

Upvotes: -1

Related Questions