adb pull multiple files

后端 未结 12 1353
挽巷
挽巷 2020-12-04 07:28

What is the best way to pull multiple files using

adb pull

I have on my /sdcard/ 25 files with following name:



        
相关标签:
12条回答
  • 2020-12-04 08:09

    ADBFS a FUSE Filesystem for Android Debug Bridge if you are using linux or mac

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

    ./adb pull /sdcard <-- fails

    ./adb pull /sdcard/ <-- works recursively - note the trailing slash

    Tested with Nexus 5 and adb downloaded March 2014.

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

    PowerShell:

    adb shell ls /sdcard/gps*.trace | foreach {adb pull $_}

    0 讨论(0)
  • 2020-12-04 08:15

    Wild cards work in my case, I have been using following simple script to import Whatsapp Images of my virtual device in to my desktop

    #! /bin/bash
    mkdir -p ~/Pictures/Pictures_adb
    rm -f ~/Pictures/Pictures_adb/*
    cd ~/Pictures/Pictures_adb
    adb root
    adb shell 'cp /data/media/0/WhatsApp/Media/WhatsApp\ Profile\ Photos/* /sdcard/Pictures/;exit'
    adb pull /sdcard/Pictures
    mv ~/Pictures/Pictures_adb/Pictures/* ~/Pictures/Pictures_adb/
    rmdir ~/Pictures/Pictures_adb/Pictures
    cd
    
    0 讨论(0)
  • 2020-12-04 08:18

    adb pull can receive a directory name instead of at file and it will pull the directory with all files in it.

    Pull all your gps traces in /sdcard/gpsTraces

    adb pull /sdcard/gpsTraces/ . 
    

    Example of adb pull and adb push of recursive directories:

    C:\Test>adb pull /data/misc/test/ .
    pull: building file list...
    pull: /data/misc/test/test1/test2/test.3 -> ./test1/test2/test.3
    pull: /data/misc/test/test1/test2/test.2 -> ./test1/test2/test.2
    pull: /data/misc/test/test1/test2/test.1 -> ./test1/test2/test.1
    pull: /data/misc/test/test1/test.3 -> ./test1/test.3
    pull: /data/misc/test/test1/test.2 -> ./test1/test.2
    pull: /data/misc/test/test1/test.1 -> ./test1/test.1
    pull: /data/misc/test/test.3 -> ./test.3
    pull: /data/misc/test/test.2 -> ./test.2
    pull: /data/misc/test/test.1 -> ./test.1
    9 files pulled. 0 files skipped.
    0 KB/s (45 bytes in 0.093s)
    
    C:\Test>adb push . /data/misc/test/
    push: ./test1/test2/test.3 -> /data/misc/test/test1/test2/test.3
    push: ./test1/test2/test.2 -> /data/misc/test/test1/test2/test.2
    push: ./test1/test2/test.1 -> /data/misc/test/test1/test2/test.1
    push: ./test1/test.3 -> /data/misc/test/test1/test.3
    push: ./test1/test.2 -> /data/misc/test/test1/test.2
    push: ./test1/test.1 -> /data/misc/test/test1/test.1
    push: ./test.3 -> /data/misc/test/test.3
    push: ./test.2 -> /data/misc/test/test.2
    push: ./test.1 -> /data/misc/test/test.1
    9 files pushed. 0 files skipped.
    0 KB/s (45 bytes in 0.062s)
    
    0 讨论(0)
  • 2020-12-04 08:19

    Parsing the output from 'ls' is generally a bad idea. Instead, use 'find'.

    adb shell 'find /sdcard/ -name "gps*.trace" -print0' | xargs -0 -n 1 adb pull
    

    Why you shouldn't parse the output of ls

    0 讨论(0)
提交回复
热议问题