如何通过git bash for windows传递adb命令的绝对路径?

B J*_*son 13 windows git bash msys adb

我正在尝试使用git bash(msy​​sgit)将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
Run Code Online (Sandbox Code Playgroud)

这样做的正确方法是什么?

Ric*_*sen 24

根据这个答案,MSYS shell根据这些规则修改文件名.根据整理规则,以下内容适合您:

adb push myfile '//mnt\sdcard\'
Run Code Online (Sandbox Code Playgroud)

(用斜杠替换第一个斜杠,用反斜杠替换所有剩余的斜杠)

  • 我能够用所有正斜杠(/)来做到这一点 (2认同)

Jay*_*yen 7

adb push myfile //mnt/sdcard

linux对重复的/s 并不挑剔