5

adb push seems to push everything into the dest folder regardless of their changed/unchanged states. So it wastes a lot of time. Is it possible to sync rather than copy (i.e. to rsync rather than cp)?

I see adb has a sync option, but I'm not quite sure whether it's relevant or not.

2

While this answer is not exactly an explanation on the usage of adb sync, it may help when your primary goal is to sync files using adb.

You may be interested in adb-sync which is a Python script that uses adb to synchronize files from your computer to your Android device or vice versa.

Example (computer -> device):

adb-sync /home/abc/ /sdcard/abc

Example (computer <- device):

adb-sync --reverse /sdcard/abc /home/abc/ 

If missing files on the source should be deleted on the target you have to specify --delete.

1

You would use adb push --sync, for example:

adb push --sync /home/abc/ /sdcard/abc

from adb --help:

file transfer:
 push [--sync] LOCAL... REMOTE
     copy local files/directories to device
     --sync: only push files that are newer on the host than the device

but it seems that this function is available for relative newer ADB version such as version 1.0.40.

0

When running adb without any commands, you get a list of possible commands, and here it is:

adb sync [ <directory> ]     - copy host->device only if changed
                             (see 'adb help all')

Looks pretty relevant to me :)

  • 3
    Would you please give an example on how to use this? Say if I want to sync /home/abc/ on PC to /sdcard/abc/ on device. – Cyker Sep 23 '12 at 5:58
  • Did you try adb help all? – pzkpfw Sep 24 '12 at 8:36
  • 3
    Yes. It can sync system/data partition. But I just want to sync one folder on sdcard. Do you know how to do that? – Cyker Sep 24 '12 at 20:22
  • It is not implemented in version <= 1.0.31. – echo Jan 29 '13 at 1:26
  • While this command looks promising at first, I couldn't get it to work after a quick try. A real example as requested by cyker would be helpful. – Flow Apr 17 '14 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.