uiautomator2 icon indicating copy to clipboard operation
uiautomator2 copied to clipboard

怎么将文件夹里所有文件复制到电脑上

Open yowrhihoil opened this issue 5 years ago • 3 comments

因为文件是固定存在一个文件夹下的,文件名是随机数,有什么方法将整个文件夹复制过来,能遍历到文件名也行。 我试着用d.pull("/storage/emulated/0/Android/dadishu/data/.", "/Users/so/data/.") 的方式运行,提示错误 [Errno 21] Is a directory:/Users/so/data/.

yowrhihoil avatar Nov 17 '19 09:11 yowrhihoil

因为文件是固定存在一个文件夹下的,文件名是随机数,有什么方法将整个文件夹复制过来,能遍历到文件名也行。 我试着用d.pull("/storage/emulated/0/Android/dadishu/data/.", "/Users/so/data/.") 的方式运行,提示错误 [Errno 21] Is a directory:/Users/so/data/.

adb shell ls {folder} -l ,可以遍历出目录下所有文件和文件夹,然后写个递归,如果是文件的话就直接pull,如果是文件夹的话就继续遍历。 目前我是使用这个方法,也正在找更好的方法

wangshijia523 avatar Mar 28 '20 08:03 wangshijia523

压缩文件夹后push,push到手机后在使用命令解压缩

gb112211 avatar Dec 28 '20 08:12 gb112211

adb push 命令可以push整个目录,不知道什么原因,u2的push方法限制只能是文件

githuuu avatar Jul 27 '21 08:07 githuuu