【发布时间】:2013-11-12 13:34:38
【问题描述】:
我正在尝试使用 git bash (msysgit) 将 unix 样式路径传递给 Android adb 命令,但 shell 错误地解释了我的路径。这是我迄今为止尝试过的:
$ adb push myfile /mnt/sdcard/
failed to copy 'myfile' to 'C:/Program Files (x86)/Git/mnt/sdcard/': No such file or directory
$ adb push myfile "/mnt/sdcard/"
failed to copy 'myfile' to 'C:/Program Files (x86)/Git/mnt/sdcard/': No such file or directory
$ adb push myfile '/mnt/sdcard/'
failed to copy 'myfile' to 'C:/Program Files (x86)/Git/mnt/sdcard/': No such file or directory
这样做的正确方法是什么?
【问题讨论】:
-
你在“cmd”(dos-prompt)中尝试过同样的方法吗?我认为它会在那里工作
-
@DevJyotiBehera 是的,我确实在 windows cmd 提示符下尝试过,它确实有效,但我试图弄清楚为什么它不适用于 msysgit。我想了解路径和引用如何在这里工作。
-
你检查过stackoverflow.com/q/11519659/1983854 吗?另外,
ls /mnt/sdcard/有效吗?看看它是否正确检测到路径。 -
这里有同样的问题。 Gitbash、adb 和推/拉请求。 gitbash 中的所有内容似乎都按照标准 bash 工作。奇怪的是,我的系统甚至通过在预期路径前加上
C:/Program Files/Git来复制您的问题。下面的两种解决方案都对我有用,所以我正在运行一个更简单的解决方案,即。adb push myfile //mnt/sdcard。救命稻草!