How do I adb pull ALL files of a folder present in SD Card

后端 未结 7 1966
傲寒
傲寒 2020-12-12 12:45

I have a folder in my SD Card as: /mnt/sdcard/Folder1/Folder2/Folder3/*.jpg

The name of Folder1 and Folder2 remains constant and inside Folder2 I have F

相关标签:
7条回答
  • 2020-12-12 12:59

    Single File/Folder using pull:

    adb pull "/sdcard/Folder1"
    

    Output:

    adb pull "/sdcard/Folder1"
    pull: building file list...
    pull: /sdcard/Folder1/image1.jpg -> ./image1.jpg
    pull: /sdcard/Folder1/image2.jpg -> ./image2.jpg
    pull: /sdcard/Folder1/image3.jpg -> ./image3.jpg
    3 files pulled. 0 files skipped.
    

    Specific Files/Folders using find from BusyBox:

    adb shell find "/sdcard/Folder1" -iname "*.jpg" | tr -d '\015' | while read line; do adb pull "$line"; done;
    

    Here is an explanation:

    adb shell find "/sdcard/Folder1" - use the find command, use the top folder
    -iname "*.jpg"                   - filter the output to only *.jpg files
    |                                - passes data(output) from one command to another
    tr -d '\015'                     - explained here: http://stackoverflow.com/questions/9664086/bash-is-removing-commands-in-while
    while read line;                 - while loop to read input of previous commands
    do adb pull "$line"; done;         - pull the files into the current running directory, finish. The quotation marks around $line are required to work with filenames containing spaces.
    

    The scripts will start in the top folder and recursively go down and find all the "*.jpg" files and pull them from your phone to the current directory.

    0 讨论(0)
  • 2020-12-12 13:00

    Please try with just giving the path from where you want to pull the files I just got the files from sdcard like

    adb pull sdcard/

    do NOT give * like to broaden the search or to filter out. ex: adb pull sdcard/*.txt --> this is invalid.

    just give adb pull sdcard/

    0 讨论(0)
  • 2020-12-12 13:04

    If you want to pull a directory with restricted access from a rooted device you need to restart adb as root: type adb root before pull. Otherwise you'll get an error saying remote object '/data/data/xxx.example.app' does not exist

    0 讨论(0)
  • 2020-12-12 13:11

    if your using jellybean just start cmd, type adb devices to make sure your readable, type adb pull sdcard/ sdcard_(the date or extra) <---this file needs to be made in adb directory beforehand. PROFIT!

    In other versions type adb pull mnt/sdcard/ sdcard_(the date or extra)

    Remember to make file or your either gonna have a mess or it wont work.

    0 讨论(0)
  • 2020-12-12 13:12

    On Android 6 with ADB version 1.0.32, you have to put / behind the folder you want to copy. E.g adb pull "/sdcard/".

    0 讨论(0)
  • 2020-12-12 13:17

    Directory pull is available on new android tools. ( I don't know from which version it was added, but its working on latest ADT 21.1 )

    adb pull /sdcard/Robotium-Screenshots
    pull: building file list...
    pull: /sdcard/Robotium-Screenshots/090313-110415.jpg -> ./090313-110415.jpg
    pull: /sdcard/Robotium-Screenshots/090313-110412.jpg -> ./090313-110412.jpg
    pull: /sdcard/Robotium-Screenshots/090313-110408.jpg -> ./090313-110408.jpg
    pull: /sdcard/Robotium-Screenshots/090313-110406.jpg -> ./090313-110406.jpg
    pull: /sdcard/Robotium-Screenshots/090313-110404.jpg -> ./090313-110404.jpg
    5 files pulled. 0 files skipped.
    61 KB/s (338736 bytes in 5.409s)
    
    0 讨论(0)
提交回复
热议问题