Skip to content

Instantly share code, notes, and snippets.

@tobrun
Last active September 25, 2017 19:04
Show Gist options
  • Save tobrun/63bf8e84a6487b9d5904a04486187e6b to your computer and use it in GitHub Desktop.
Save tobrun/63bf8e84a6487b9d5904a04486187e6b to your computer and use it in GitHub Desktop.
A common issue that Android developers face with copying files between device and development machine is that the structure of the external storage folders can differ. A robust way of getting files through adb is using the EXTERNAL_STORAGE environment variable of the device as a base.
# below matches files saved to Environment.getExternalStorageDirectory() + "/from/path"
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/from/path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment