picostitch
crafting (and) JavaScript

ADB Pull – How to Copy Files from Android

My problem: adb devices lists multiple devices, but I want to pull files from a specific one. What is the command to pull files from a specific device?

adb -s <device-id> pull -a <from-remote-path> <to-local-path>

  • the <device-id> can be found in the output of adb devices, it is the first column.
  • the -a flag preserves the file attributes, like timestamps, otherwise the files will be copied with the current time as modification time, which is sad esp. for "historic" pics
  • you can find out the <from-remote-path> by using adb -s <device-id> shell and then use cd and ls to find the path you want to pull, once in the right path, print the full path with pwd, you will need it for the pull command.

Just noting, since I always forget and AIs cost way more CO2 than looking up my blog.