2

I wish to pull a directory from an Android device which contains screenshots, reason why, is that I don't know the name of these screenshots to pull them 1 by 1, so pulling the directory seemed a better idea.

My command is,

adb pull "\\$EXTERNAL_STORAGE/screen/" .

However I get the error,

remote object '\\$EXTERNAL_STORAGE/screen/' does not exist

I have tried with and without the trailing '/' but both same error message, and I have verified that 'screen' does actually exist.

My question, is it even possible to pull a directory, as opposed to individual files, and if so, what am I doing incorrect?

EDIT: I have read a similar issue, but my device still shows the error above rather than "Is a directory" Recursive adb pull

Thanks.

jerrythebum
  • 153
  • 1
  • 7

2 Answers2

0

If the screenshots are getting saved in external SD card then I believe external SD card is set as default write-disk. In that case, you can do,

adb pull /sdcard/{YOUR_DIR}/ {TARGET_DIR}

I use my custom alias named adbshots which is,

/usr/bin/adb pull /sdcard/Pictures/Screenshots/ /root
Firelord
  • 25,084
  • 20
  • 124
  • 286
  • thanks, this did work. I was attempting to utilise the EXTERNAL_STORAGE parameter but its fine. On further thought, I guess its that adb pull does not initialise local parameters like adb shell does; therefore it doesn't work. – jerrythebum Aug 25 '15 at 11:24
  • Your $EXTERNAL_STORAGE seems to be a variable initialized in your OS. It needs to be a path like /XYZ/ABC/ -- the *nix way which ADB can use to trace the source dir in Android. While the question is solved, you may still troubleshoot the issue. See what is the value of $EXTERNAL_STORAGE. – Firelord Aug 25 '15 at 11:31
  • $EXTERNAL_STORAGE points to the path of the external sdcard on the device.

    adb shell echo \$EXTERNAL_STORAGE

    /storage/emulated/legacy

    I just wanted to use that to find te location of the ext sd card, I was unaware that /sdcard/ was basically a pointer to what I was attempting

    – jerrythebum Aug 25 '15 at 11:56
  • It is true that $EXTERNAL_STORAGE points to the external SD card but the variable has its scope inside the Android. When you use it with adb pull, then ADB treats it as a variable defined in the host system, ultimately, the command would fail if the variable is not defined or initialized explicitly in your host or the current shell session. – Firelord Aug 25 '15 at 12:23
-1

try this. This should work.

adb pull /sdcard/screen/

Saif-RX
  • 21
  • 4
  • Typical usage of adb pull goes by adb pull <remote> <local>. Please explain how your command is relevant for the objective OP wants to achieve. – Firelord Aug 25 '15 at 11:35
  • Yes, that point is true that <local> is not needed if you want the source to be copied into the directory from where the shell is invoked from. But in your command, /sdcard/. is <remote> and screen is <local>. It would fail for sure. – Firelord Aug 25 '15 at 12:06
  • Firelord Thanks for reply it was a mistake.I have corrected it. – Saif-RX Aug 25 '15 at 12:09