python .\adb-sync

usage: adb-sync [-h] [-e COMMAND] [--device] [--emulator] [-s DEVICE] [-H HOST] [-P PORT] [-R] [-2] [-t] [-d] [-f] [-n] [-L] [--dry-run]
                SRC [SRC ...] DST
adb-sync: error: the following arguments are required: SRC, DST

 

python .\adb-sync --help
usage: adb-sync [-h] [-e COMMAND] [--device] [--emulator] [-s DEVICE] [-H HOST] [-P PORT] [-R] [-2] [-t] [-d] [-f] [-n] [-L] [--dry-run]
                SRC [SRC ...] DST

Synchronize a directory between an Android device and the local file system

positional arguments:
  SRC                   The directory to read files/directories from. This must be a local path if -R is not specified, and an Android path if -R is specified. If SRC does not end with a final slash, its last path component is appended to DST (like rsync does).

举个例子,如果源路径是 /path/to/source,目标路径是 /destination/,那么如果不是以斜杠结尾,最后的路径组件 source 将会被追加到目标路径中,结果是目标路径变为 /destination/source
  DST                   The directory to write files/directories to. This must be an Android path if -R is not specified, and a local path if -R is specified.

optional arguments:
  -h, --help            show this help message and exit
  -e COMMAND, --adb COMMAND
                        Use the given adb binary and arguments.
  --device              Directs command to the only connected USB device; returns an error if more than one USB device is present. Corresponds to the "-d" option of adb.
  --emulator            Directs command to the only running emulator; returns an error if more than one emulator is running. Corresponds to the "-e" option of adb.
  -s DEVICE, --serial DEVICE
                        Directs command to the device or emulator with the given serial number or qualifier. Overrides ANDROID_SERIAL environment variable. Use "adb devices" to list all connected devices with their respective serial number. Corresponds to the "-s" option of adb.
  -H HOST, --host HOST  Name of adb server host (default: localhost). Corresponds to the "-H" option of adb.
  -P PORT, --port PORT  Port of adb server (default: 5037). Corresponds to the "-P" option of adb.
  -R, --reverse         Reverse sync (pull, not push).
  -2, --two-way         Two-way sync (compare modification time; after the sync, both sides will have all files in the respective newest version. This relies on the clocks of your system and the device to match.
  -t, --times           Preserve modification times when copying.
  -d, --delete          Delete files from DST that are not present on SRC. Mutually exclusive with -2.
  -f, --force           Allow deleting files/directories when having to replace a file by a directory or vice versa. This is disabled by default to prevent large scale accidents.
  -n, --no-clobber      Do not ever overwrite any existing files. Mutually exclusive with -f.
  -L, --copy-links      transform symlink into referent file/dir
  --dry-run             Do not do anything - just show what would be done.

posted @ 2024-03-23 00:29  hrdom  阅读(6)  评论(0编辑  收藏  举报