Monday, November 18, 2013

Copying files from Android to Ubuntu

Ever tried to copy a lot of files from Android to Linux.  Why is it not supported by MTP, etc?  I don't know.  But luckily you can use ADB.  However, it seems when copying a lot of files, ADB times out.

So use a script such as:

adb shell ls /sdcard/DCIM/Camera |sed  "s?^?adb pull /sdcard/DCIM/Camera/?" |sed "s/$/ ./"|sed "s/^M//g"

Then execute the output.

For example,

adb shell ls /sdcard/DCIM/Camera |sed  "s?^?adb pull /sdcard/DCIM/Camera/?" |sed "s/$/ ./"|sed "s/^M//g"|xargs