adb-sync is a tool to synchronize files between a PC and an Android device using the ADB (Android Debug Bridge).
Before getting used to this, please review this list of projects that are somehow related to adb-sync and may fulfill your needs better:
First you need to enable USB debugging mode. This allows authorized computers (on Android before 4.4.3 all computers) to perform possibly dangerous operations on your device. If you do not accept this risk, do not proceed and try using go-mtpfs instead!
On your Android device:
Build Numberseven times.
for an existing IDEis sufficient). Alternatively, some Linux distributions come with a package named like
android-tools-adbthat contains the required tool.
adbis in your PATH. If you use a package from your Linux distribution, this should already be the case; if you used the SDK, you probably will have to add an entry to PATH in your ~/.profile file, log out and log back in.
git clone https://github.com/google/adb-sync
cp adb-sync /usr/local/bin/
To get a full help, type:
To synchronize your music files from ~/Music to your device, type one of:
adb-sync ~/Music /sdcard adb-sync ~/Music/ /sdcard/Music
To synchronize your music files from ~/Music to your device, deleting files you removed from your PC, type one of:
adb-sync --delete ~/Music /sdcard adb-sync --delete ~/Music/ /sdcard/Music
To copy all downloads from your device to your PC, type:
adb-sync --reverse /sdcard/Download/ ~/Downloads
This package also contains a separate tool called adb-channel, which is a convenience wrapper to connect a networking socket on the Android device to file descriptors on the PC side. It can even launch and shut down the given application automatically!
It is best used as a
ProxyCommand for SSH (install
first) using a configuration like:
Host sshelper Port 2222 ProxyCommand adb-channel tcp:%p com.arachnoid.sshelper/.SSHelperActivity 1
After adding this to
Congratulations! You can now use
sshfs etc. to the host name
Patches to this project are very welcome.
Before sending a patch or pull request, we ask you to fill out one of the Contributor License Agreements:
This is not an official Google product.