I did 3 things to pull all files of the same type, in this case *.mp4 (all videos)
1. First copy the output of: {all videos listed} with xargs to a file.txt
adb shell ls /storage/7C17-B4FD/DCIM/Camera/*.mp4 | xargs -t -I % echo % >> file.txt
adb shell ls /storage/7C17-B4FD/DCIM/Camera/*.mp4
returns all videos listed in device.
The argument -t
show the output from XARGS, and -I
lets you use a variable, in this case represented with %
then you write the command you want to do. In this case, echo %
each line and add it to the file.txt
2. You need to clean the file.txt from spaces and the '\r'
you do it with the command tr
tr -d '\r' < file.txt > text-clean.txt
the input file is < file.txt
and the new output file is > text-clean.txt
3.Now you can cat
the new clean file text-clean.txt
and use that input with XARGS command to pass the command adb pull
for each file.
cat text-clean.txt | xargs -t -I % adb pull % ./
we cat
the content of text-clean.txt
and send the output to XARGS, then we see what is the result of command with -t
and -I
to add variables. adb pull
to request file from path which is represented with %
and ./
means copy to this directory or currrent directory of where you are.
if you just need to copy one file. just need to find the file with adb shell ls /path/to/file
and the just copy to your location with adb pull
. example
adb pull /storage/7C717-B4FD/DCIM/Camera/video1.mp4 ./