sd卡有多个android文件夹|sd卡有多个android文件夹,android - 如何adb拉出SD卡中存在的文件夹的所有文件

android - 如何adb拉出SD卡中存在的文件夹的所有文件
我的SD卡中有一个文件夹:/mnt/sdcard/Folder1/Folder2/Folder3/*.jpg
Folder1和Folder2的名称保持不变,在Folder2中我有Folder3,4,5等等。我想把所有的jpeg文件,而不是所有文件(还有更多)用adb到计算机上的当前目录。
每个文件夹都有不同数量的jpeg文件和其他文件,我尝试使用这个:
adb pull mnt/sdcard/Folder1/Folder2/Folder/*.jpg .
但它没有工作..所以,我怎么用一个命令adb拉出SD卡的任何文件夹中的所有文件(单个命令因为每个文件夹有不同的文件数)
7个解决方案
120 votes
单个文件/文件夹:find:
adb pull "/sdcard/Folder1"
输出:
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.
特定文件/文件夹:find来自BusyBox:
adb shell find "/sdcard/Folder1" -iname "*.jpg" | tr -d '\015' | while read line; do adb pull "$line"; done;
这是一个解释:
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.
脚本将从顶部文件夹开始,递归地向下查找所有" *。jpg" 文件并将它们从手机中拉到当前目录。
Jared Burrows answered 2019-08-08T18:59:52Z
70 votes
目录拉动可用于新的Android工具。(我不知道它是从哪个版本添加的,但它在最新的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)
Palani answered 2019-08-08T19:00:11Z
38 votes
请尝试只提供您要从中提取文件的路径我只是从SD卡中获取了文件
adb pull sdcard/
不要*喜欢扩大搜索范围或过滤掉。例如:adb pull sdcard / * .txt - > 这是无效的。
刚给adb拉sdcard /
Narenderan Perumal answered 2019-08-08T19:00:56Z
6 votes
是的,只需使用尾部斜杠递归拉取目录。 适用于Nexus 5和当前版本的adb(2014年3月)。
Posting as a guesty-guest answered 2019-08-08T19:01:21Z
2 votes
在具有ADB版本1.0.32的Android 6上,您必须将要复制的文件夹放在/后面。 例如,adb pull "/sdcard/".
antimatter answered 2019-08-08T19:01:46Z
1 votes
如果您使用jellybean刚启动cmd,请键入adb设备以确保您的可读性,输入adb pull sdcard / sdcard_(日期或额外)< ---此文件需要事先在adb目录中生成。 利润!
在其他版本中键入adb pull mnt / sdcard / sdcard_(日期或额外)
记得制作文件或者你要么弄得一团糟,要么就行不通。
EDward answered 2019-08-08T19:02:25Z
0 votes
如果要从root设备中提取具有受限访问权限的目录,则需要以root身份重新启动adb:在pull之前键入adb root。 否则,您将收到错误提示remote object '/data/data/xxx.example.app' does not exist
【sd卡有多个android文件夹|sd卡有多个android文件夹,android - 如何adb拉出SD卡中存在的文件夹的所有文件】naXa answered 2019-08-08T19:02:50Z

    推荐阅读