0

I know I can pull file from android like this

adb pull /sdcard/file.txt

But I try to do something else

First I search for the last edited file like this

tmp123=$(adb shell ls /sdcard/file.* -aR . | head -n 1)

and then I try this

adb pull $tmp123

and I get something like this

' does not existsdcard/file.txt

I bet it is something very stupid mistake but I am stack for hours Thanks

1 Answers1

0

There may be a '\r' new line character at the end of adb output

You may try something like this:

tmp123=$(adb shell ls /sdcard/file.* -aR . | head -n 1 | tr -d '\r')

refer to this question for a possible solution

Community
  • 1
  • 1
Rakesh Gupta
  • 3,507
  • 3
  • 18
  • 24