“adb pull”抛出“不存在”

时间:2015-07-17 10:12:20

标签: android adb

当我执行命令时:
for el in $(adb shell ls /mnt/sdcard/ | grep mem_); do adb pull /mnt/sdcard/${el} android_mem; done
我明白了:
' does not existmnt/sdcard/mem_AI ' does not existmnt/sdcard/mem_Alarms ' does not existmnt/sdcard/mem_Android ' does not existmnt/sdcard/mem_Autodesk ' does not existmnt/sdcard/mem_Cardboard ' does not existmnt/sdcard/mem_DCIM ...
但是,如果我执行此操作,例如,adb pull /mnt/sdcard/mem_DCIM android_mem我得到0 KB/s (20 bytes in 0.080s),即确定。为什么会这样?

1 个答案:

答案 0 :(得分:3)

问题是 $(document).on("click", ".glyphicon-trash", function (){ $(this).parent().parent().remove(); // remove row 最后会返回adb shell ls /mnt/sdcard/ | grep mem_,因此无法正确提取文件。

因此您需要使用\r将其删除,例如:

sed -r 's/[\r]+//g'