Android:adb.exe拉/mnt/sdcard/somefile.txt不能正常工作?

时间:2012-07-17 09:28:50

标签: android adb pull

也许我做错了什么。我正在尝试使用adb命令从我的设备获取文件:

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

但我总是收到消息:

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

该设备上的文件:

adb shell ls /mnt/sdcard/deviceinfo.dat

返回

/mnt/extsd/deviceinfo.dat

我尝试过一些变种:

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

但我总是得到同样的错误。拉的问题在哪里?我正在以管理员身份运行cmd.exe。

5 个答案:

答案 0 :(得分:11)

经过几个小时的痛苦后,我会回答我自己的问题......

cmd.exe是使用鼠标使用上下文菜单选项“以管理员身份运行”启动的,但不幸的命令失败,因为由于某种原因,adb.exe无法写入本地文件。所以错误:cannot create 'c:\\deviceinfo.dat' ...

现在正确的步骤:

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

我不明白为什么在上下文菜单中使用“以管理员身份运行”(在我的Win7栏上右键单击命令提示符图标后)无法正常工作。

答案 1 :(得分:4)

我通过在目标路径中创建一个文件夹来解决相同的问题。例如,adb pull /sdcard/a.txt D:\您将收到错误消息。在D:\中创建临时文件夹,然后使用adb pull /sdcard/a.txt D:\temp,一切正常!在adb 1.0.36版本中发现了此问题。

答案 2 :(得分:1)

确保文件/子文件夹中没有非法字符。在我的情况下,文件和文件夹的名称中带有:

答案 3 :(得分:0)

也可能是文件alread存在于您想要拉出它的位置,并且正在使用或写保护,因此无法覆盖。

答案 4 :(得分:-1)

你需要检查你传递的每个文件是否有效,如:

--in your command cmd.

--cd c: press enter

--cd mnt press enter.

--cd sdcard press enter.

--deviceinfo.dat

然后你就能得到你想要的东西。