[Android Q&A, Help & Troubleshooting] Cpt_Birdseye:
Hello XDA-Devs,

I have to admit that I am not an Android or other smartphone OS developer but merely a dimwitted device user who struggles to get data off and onto his Android device.

First I thought that one could simply plug the device into one of my laptop's USB ports and mount it like any mass storage device.

But I had to learn that this simple mode has disappeared in Android versions higher than 2.X.

After several rather dissatisfying other attempts to transfer data, like e.g. via an OpenSSH server app on my (not yet rooted device), I finally came across a seemingly more appealing solution via the ADB USB mode, where the necessary steps were described in blog's posting whose link I not yet allowed to place here (i.e. <10 posts).

After a bit of fiddling I managed to get my device connected via USB and the ADB daemon.

Now I am still struggling how to efficiently get a bulk of e..g camera images from my device.

So far adb pull seems to be the appropriate command.

But somehow I can only download/pull single image files, and my loop isn't working.

Sadly the pull command doesn't have a bulk match option like an ftp client's mget.housand

Also I can't work out if shell globbing works the same as in an e.g. Bash.

See, while I can fetch a list of files, the loop expansion doesn't work, for what reason ever, and I would have to pull every file separately.

That looks strange. Maybe I only fell prey to some shell glob syntax issue here?

So bear with me.

[fiddle@dellinsp:~/Pictures]
$ for f in $(adb shell ls /storage/sdcard0/DCIM/Camera/);do echo adb pull "/storage/sdcard0/DCIM/Camera/$f";done|tail
adb pull /storage/sdcard0/DCIM/Camera/20131111_192956.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193008.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193018.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193028.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193036.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193048.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131111_193114_1.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131113_005357.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131113_005418.jpg
adb pull /storage/sdcard0/DCIM/Camera/20131113_005526.jpg

But when I remove the echo

[fiddle@dellinsp:~/Pictures]
$ for f in $(adb shell ls /storage/sdcard0/DCIM/Camera/);do adb pull "/storage/sdcard0/DCIM/Camera/$f";done 2>&1|tail
' does not existstorage/sdcard0/DCIM/Camera/20131111_192956.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193008.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193018.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193028.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193036.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193048.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131111_193114_1.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131113_005357.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131113_005418.jpg
' does not existstorage/sdcard0/DCIM/Camera/20131113_005526.jpg

But on a single file invocation I can pull it.

[fiddle@dellinsp:~/Pictures]
$ adb pull -p /storage/sdcard0/DCIM/Camera/20131113_005526.jpg
Transferring: 569030/569030 (100%)
1966 KB/s (569030 bytes in 0.282s)
[fiddle@dellinsp:~/Pictures]
$ identify 20131113_005526.jpg
20131113_005526.jpg JPEG 1920x1080 1920x1080+0+0 8-bit DirectClass 556kb

Strange.

I am convinced that there must be a more efficient way to bulk pull files from my device.