Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android adb在Pc的特定文件夹中拉取文件_Android_Python_Shell_Adb_Pull - Fatal编程技术网

Android adb在Pc的特定文件夹中拉取文件

Android adb在Pc的特定文件夹中拉取文件,android,python,shell,adb,pull,Android,Python,Shell,Adb,Pull,我想将创建的屏幕截图保存在电脑的特定文件夹中 cmd = 'adb shell screencap -p /sdcard/screen.png' subprocess.Popen(cmd.split()) time.sleep(5) cmd ='adb pull /sdcard/screen.png screen.png' subprocess.Popen(cmd.split()) 如果我想在我的工作区中使用该图像,则可以使用此选项。但是如果我想把截图放到另一个文件夹中,它就不起作用了

我想将创建的屏幕截图保存在电脑的特定文件夹中

cmd = 'adb shell screencap -p /sdcard/screen.png'
subprocess.Popen(cmd.split())
time.sleep(5)  
cmd ='adb pull /sdcard/screen.png screen.png'
subprocess.Popen(cmd.split()) 
如果我想在我的工作区中使用该图像,则可以使用此选项。但是如果我想把截图放到另一个文件夹中,它就不起作用了

cmd ='adb pull /sdcard/screen.png C:\Users\xxx\Desktop\prova\screen.png'
subprocess.Popen(cmd.split())
如果我从cmd运行命令,我有: Android调试桥版本1.0.31

-d                            - directs command to the only connected USB device
                                 returns an error if more than one USB device is present.
 -e                            - directs command to the only running emulator.
                                 returns an error if more than one emulator is running.
 -s <specific device>          - directs command to the device or emulator with the given
                                 serial number or qualifier. Overrides ANDROID_SERIAL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.
                                 If -p is not specified, the ANDROID_PRODUCT_OUT
                                 environment variable is used, which must
                                 be an absolute path.
 devices [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number is specified.
                                 Using this command with no additional arguments
                                 will disconnect from all connected TCP/IP devices.

device commands:
  adb push <local> <remote>    - copy file/dir to device
  adb pull <remote> [<local>]  - copy file/dir from device
  adb sync [ <directory> ]     - copy host->device only if changed
                                 (-l means list but don't copy)
                                 (see 'adb help all')
  adb shell                    - run remote shell interactively
  adb shell <command>          - run remote shell command
  adb emu <command>            - run emulator console command
  adb logcat [ <filter-spec> ] - View device log
  adb forward <local> <remote> - forward socket connections
                                 forward specs are one of: 
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
                                   dev:<character device name>
                                   jdwp:<process pid> (remote only)
  adb jdwp                     - list PIDs of processes hosting a JDWP transport
  adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
                               - push this package file to the device and install it
                                 ('-l' means forward-lock the app)
                                 ('-r' means reinstall the app, keeping its data)
                                 ('-s' means install on SD card instead of internal storage)
                                 ('--algo', '--key', and '--iv' mean the file is encrypted already)
  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories)
  adb bugreport                - return all information from the device
                                 that should be included in a bug report.

  adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
                               - write an archive of the device's data to <file>.
                                 If no -f option is supplied then the data is written
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the device's
                                    shared storage / SD card contents; the default is noshared.)
                                 (-all means to back up all installed applications)
                                 (-system|-nosystem toggles whether -all automatically includes
                                    system applications; the default is to include system apps)
                                 (<packages...> is the list of applications to be backed up.  If
                                    the -all or -shared flags are passed, then the package
                                    list is optional.  Applications explicitly given on the
                                    command line will be included even if -nosystem would
                                    ordinarily cause them to be omitted.)

  adb restore <file>           - restore device contents from the <file> backup archive

  adb help                     - show this help message
  adb version                  - show version num

scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb status-window            - continuously print device status for a specified device
  adb remount                  - remounts the /system partition on the device read-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
  adb reboot-bootloader        - reboots the device into the bootloader
  adb root                     - restarts the adbd daemon with root permissions
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking:
  adb ppp <tty> [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
 <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
 [parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
  <localdir> can be interpreted in several ways:

  - If <directory> is not specified, both /system and /data partitions will be updated.

  - If it is "system" or "data", only the corresponding partition
    is updated.

environmental variables:
  ADB_TRACE                    - Print debug information. A comma separated list of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.
-d-将命令定向到唯一连接的USB设备
如果存在多个USB设备,则返回错误。
-e-将命令定向到唯一正在运行的仿真器。
如果正在运行多个仿真器,则返回错误。
-s-将命令定向到具有给定
序列号或限定符。重写ANDROID\u序列
环境变量。
-p-简单的产品名称,如“更早”,或
产品的相对/绝对路径
输出目录,如“out/target/product/project”。
如果未指定-p,则ANDROID_产品将退出
使用了环境变量,该变量必须
这是一条绝对的道路。
设备[-l]-列出所有连接的设备
(“-l”还将列出设备限定符)
连接[:]-通过TCP/IP连接到设备
如果未指定端口号,则默认情况下使用端口5555。
断开连接[[:]]-断开与TCP/IP设备的连接。
如果未指定端口号,则默认情况下使用端口5555。
使用此命令时不带其他参数
将从所有连接的TCP/IP设备断开连接。
设备命令:
adb推送-将文件/目录复制到设备
adb pull[]-从设备复制文件/目录
adb sync[]-仅在更改时复制主机->设备
(-l表示列表,但不复制)
(见“亚洲开发银行帮助所有人”)
adb shell-以交互方式运行远程shell
adb shell-运行远程shell命令
adb emu-运行模拟器控制台命令
adb logcat[]-查看设备日志
adb正向-正向套接字连接
正向规范是以下规范之一:
tcp:
本地摘要:
本地保留:
本地文件系统:
开发人员:
jdwp:(仅远程)
adb jdwp-列出承载jdwp传输的进程的PID
adb安装[-l][-r][-s][--algo--key--iv]
-将此程序包文件推送到设备并安装
(“-l”表示应用程序的前向锁定)
(“-r”表示重新安装应用程序,保留其数据)
(“-s”表示安装在SD卡上而不是内部存储器上)
('--algo'、'--key'和'--iv'表示文件已加密)
adb卸载[-k]-从设备中删除此应用程序包
(“-k”表示保留数据和缓存目录)
adb bugreport-从设备返回所有信息
这应该包含在bug报告中。
adb备份[-f][-apk |-noapk][-shared |-noshared][-all][-system |-nosystem][]
-将设备数据的存档写入。
如果未提供-f选项,则写入数据
到当前目录中的“backup.ab”。
(-apk |-noapk启用/禁用.apk本身的备份
在存档中;默认值为noapk。)
(-shared |-noshared启用/禁用设备的备份
共享存储/SD卡内容;默认为无共享。)
(-备份所有已安装应用程序的所有方法)
(-system |-nosystem切换是否-所有自动包括
系统应用程序;默认情况下包括系统应用程序)
(是要备份的应用程序列表。如果
传递-all或-shared标志,然后返回包
列表是可选的。应用程序在
命令行将包括在内,即使-nosystem
通常会导致忽略它们。)
adb restore-从备份档案还原设备内容
adb帮助-显示此帮助消息
adb版本-显示版本号
脚本编写:
adb等待设备-阻止,直到设备联机
adb启动服务器-确保有一台服务器正在运行
adb kill server-如果服务器正在运行,则将其杀死
adb获取状态-打印:脱机|引导加载程序|设备
adb获取序列号-打印:
adb获取devpath-打印:
adb状态窗口-连续打印指定设备的设备状态
adb remount-在设备读写上重新安装/系统分区
adb reboot[bootloader | recovery]-可选择将设备重新引导到引导加载程序或恢复程序中
adb reboot bootloader-将设备重新引导到引导加载程序中
adb root-使用root权限重新启动adbd守护程序
亚洲开发银行usb
cmd = "adb pull /sdcard/screen.png \"C:\\Users\\xxx\\Desktop\\prova\\screen.png\"";