简体   繁体   中英

creating adb pull bash command

When I run below command directly on prompt, it works fine by pulling all files from emulator sdcard:

adb -s emulator-5556 pull /sdcard/.

However when I create bash file (extract.sh) with above command and run it I get following error:

remote object 'C:/Program Files (x86)/Git/sdcard/' does not exist

As can be seen it somehow adds C:/Program Files (x86)/Git before it. These are the contents of bash file:

#!/bin/bash
adb -s emulator-5556 pull /sdcard/.

Does anyone have an idea of why it works when direcly typing on prompt and not via bash file ? Thanks

Is there any reason you're not specifying the destination directory? For example, the batch command I use when pulling pictures from my phone over USB is adb pull "/sdcard/DCIM/Camera" "E:\\Phone Pics\\HTC DNA" which specifies both the source directory on the phone and the destination directory on my computer. As a side note, like enedil I recommend using this in a batch file when working in Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM