Skip to content

Instantly share code, notes, and snippets.

@michaellee8
Last active July 23, 2017 05:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaellee8/72fce42784bc6b18de42d6724a9826da to your computer and use it in GitHub Desktop.
Save michaellee8/72fce42784bc6b18de42d6724a9826da to your computer and use it in GitHub Desktop.
Fast android file transfer between devices/phones/tablets using adb
# Mini bash script to quickly copy files between android devices using adb
# dependencies : depends on adb, install first by sudo apt install adb
# $1 : serialno of source device
# $2 : serialno of destination device
# $3 : parent directory of file/dir to be copied
# $4 : name of file/dit to be copied
# example : bash android-file-transfer <device-sn-source> <device-sn-destination> /sdcard/ DCIM
# remarks : if it shows the devices is currently offline, set the device's USB mode to MTP
# remarks : to get serialno of connected devices, used adb devices -l
# remarks : uses USB 3.0 port if aviliable
adb -s $1 pull $3$4 ./android-file-trans-tmp && adb -s $2 push ./android-file-trans-tmp/$4 $3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment