我正在尝试使用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
这样做的正确方法是什么?
答案 0 :(得分:23)
根据this answer,MSYS shell根据these rules修改文件名。根据修改规则,以下内容对您有用:
adb push myfile '//mnt\sdcard\'
(用两个斜杠替换第一个斜杠,用反斜杠替换所有剩余的斜杠)
答案 1 :(得分:6)
adb push myfile //mnt/sdcard
linux对重复/
s