AdbSync is a Win32 utility for syncing files to and from an Android device.
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.
To access all storage areas on your device the ADB running on your device must be rooted. There are three possible conditions: rooted, rootable, non-rootable. Only real rooted gives you access to all of storage like /data.
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).
/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
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...
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.
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.
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.
The /0
is a hack that considers timestamps that are different by exactly ±1 hour to be equivalent.
It is used when daylight savings has affected all the timestamps on a VFAT filesystem to prevent everything from being updated.
Show usage:
Copy photos to desktop (but see above about /sdcard):
Copy music to Android:
Backup application data (requires real rooted):
Synchronize in both directions text memos:
Download the executable.