AdbSync


AdbSync is a Win32 utility for syncing files to and from an Android device.

usage: adbsync [flags] hostroot androidroot [altroot] /h update host /a update android /s search subdirectories /l list all files or d (differences), h (host only), a (android only) /i ignore files in pattern list /o only files in pattern list /d device name /v verbose /q quiet /1 use 1 second resolution (ext*) /2 use 2 second resolution (vfat) /h and /a use s (create subdirs), c (create files), u (update files), default=cu. Pattern lists are *? format, semicolon delimited.

Operation

AdbSync uses the stock ADB server daemon running on the Windows host. If you are making a batch file you probably want to start with adb start-server. If the ADB server is already running, this will have no effect.

AdbSync can update the host (Windows), the Android or both. The /h, /a, /s flags control the operation.

Paths

The host paths are specified in Windows (backslash) format using the host current directory. The Android paths are specified in Linux (forward slash) format using the Android root directory. Don't start an Android path with a slash because it will be interpreted as a command flag (and it is unnecessary).

Working with the /sdcard directory

/sdcard on an Android is usually a link. With some Androids you may need to use actual paths with AdbSync (because the links are not followed). Often /sdcard will be the start of a series of links. Be sure to follow to the end. You can use ls -l or readlink.

A few examples:
/sdcard -> /storage/emulated/legacy -> /mnt/shell/emulated/0
/sdcard -> /storage/self/primary -> /mnt/user/0/primary -> /storage/emulated/0

Filtering by File Name or Type

The /i flag will ignore selected files. Example: /i*.jpg;*.png means ignore JPEGs or PNGs.

The /o flag will only sync selected files. Example: /oreport?.pdf means only sync report1.pdf, report2.pdf...

Ignoring Directories

If a file with the name of ".noadbsync" is placed in a directory in either the host or Android, that directory will be ignored. That file can be of length zero.

Device Selection

The optional /d flag specifies which ADB device to use. Example: /d12345678

It's probably a good idea to specify this in batch files to prevent the wrong device from being updated.

Timestamp resolution

VFAT and DOS filesystems only have a file timestamp resolution of 2 seconds. When comparing timestamps from modern filesystems this may cause anomalies. The default of AdbSync is to use 2 second resolution. The /1 allows timestamp comparisons of 1 second. This should only be used when both the host and Android root filesystems are using 1 second resolution.

Download the executable.