FORUMS
Remove All Ads from XDA

adbsync.exe - Win32 command line syncer

2,453 posts
Thanks Meter: 1,143
 
By Renate NST, Inactive Recognized Developer / Recognized Contributor on 4th February 2013, 08:15 PM
Post Reply Email Thread
Because of the incredible success of my adbsync.exe on the Nook Touch (19 downloads! )
I've decided to advertise it to the general Android public.

There are all sorts of GUI file managers that serve as a front end to ADB.
(Some of them appear to use shelling to ADB instead of using port 5037.)
I wanted a command line program for Win32 that could sync my devices before I go out the door.
It had to work with a Nook Touch (2.1) connected on WiFi and a Kyocera Rise (4.0) connected on USB, often at the same time.

As any program with "option-itis", it runs into an alphabet soup of arguments.
The good part is that you mostly just have to get it right once and stick it in a batch or makefile.
There are options for recursive and whether to create missing subdirs or files.
It can copy in either or both direction and even a 3rd destination for resolving discrepancies.
Code:
usage:  adbsync [flags] hostroot androidroot [altroot]

/d  device name
/h  update host
/a  update android
/s  search subdirectories
/l  list files: d (differences), h (host only), a (android only)
/i  ignore files in pattern list
/o  only files in pattern list
/v  verbose
/q  quiet
/1  use 1 second resolution (ext*)
/2  use 2 second resolution (vfat)
Examples:
Code:
Update android
adbsync C:\Books "sdcard/My Files/Books" /a /v

Sync both directions
adbsync C:\Notes sdcard/Notes /a /h /v

Sync both directions but don't overwrite the PC, use another dir
adbsync C:\Notes sdcard/Notes C:\Fixme /a /h /v

Sync both directions including subdirectories
adbsync C:\Stuff sdcard/Stuff /a /h /s /v

Sync only existing files on android
adbsync C:\Reference sdcard/Reference /au /s /v

Update host with photos shot on handy (specifying device by id)
adbsync /d7a12820e /h C:\Handy\Photos sdcard/DCIM/Camera

Update android with photos, but not vacation ones
adbsync C:\Photos sdcard/Photos /o*.jpg;*.jpeg /ivacation* /a /v
Note: For many systems sdcard is just a link (which adbsync.exe will not follow).
Use mnt/sdcard

Download in the signature.
The Following 15 Users Say Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
 
 
5th February 2013, 11:06 PM |#2  
E:V:A's Avatar
Inactive Recognized Developer
Flag -∇ϕ
Thanks Meter: 2,211
 
More
Looks nice, but the problem is that it is hard to determine whether or not it is useful...since it is not clear what it is doing. What do you mean when you say "sync"? Perhaps give an example when you need this and a screen shot or two...
6th February 2013, 04:40 AM |#3  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Quote:
Originally Posted by E:V:A

Looks nice...

Thanks for the bump!

adbsync.exe compares the timestamps on files on the host and android.
If the flags allow it, it will copy the newer file over the older one.
If the alternate root is specified and it would have overwritten the host's older file it will instead write to that directory.

The post above gives lots of examples.
If files are copied over, they will be listed.
if the /v (verbose) flag is specified, it will list statistics.
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
6th February 2013, 08:09 PM |#4  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
There seems to be some problem with DDOS on Dev-Host.

Try the signature below now to download adbsync.exe
2nd July 2013, 09:52 PM |#5  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,210
 
Donate to Me
More
This is an indispensable utility for Windows users wanting a complete snapshot of their device + sdcard with their backups. And a great time saver versus standard adb pull. Highly recommended!

Glad to see this over in the main Android Development and Hacking section finally.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
19th July 2013, 12:05 AM |#6  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
I've updated this a bit to correct for a few bugs.

There were a few anomalies if you tried to use the root of Android or the root of a Windows disk.

It will not try to copy links anymore.

If there is a permission problem with reading on the Android it will say so.

I should get around to adding options for ignoring errors, right now it stops.

Finally on your device /sdcard may be only a link.
Use the appropriate real path, probably /mnt/sdcard

Download in signature.
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
29th August 2013, 08:46 AM |#7  
Senior Member
Flag Chennai
Thanks Meter: 22
 
More
Not copying
I have empty folder in my PC named sdcard and i want to copy all my phone sdcard content to this folder. I used below comment but its not copying anything it just tells "A Android Dir only 33"

can you tell me what i am doing wrong?

adbsync /h /s /v "c:\Name\Name\Soft\Mobile_Soft\Nexus\sdcard\" "/mnt/shell/emulated/0"
29th August 2013, 11:51 AM |#8  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Quote:
Originally Posted by mejack03

Can you tell me what i am doing wrong?

Code:
adbsync /hscu /s /v "c:\Name\Name\Soft\Mobile_Soft\Nexus\sdcard\" "/mnt/shell/emulated/0"
The default action is not to create directories that do not already exist.
Code:
adbsync /?
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
2nd September 2013, 04:49 AM |#9  
Pkt_Lnt's Avatar
Recognized Contributor
Flag SLO
Thanks Meter: 5,816
 
More
I am trying to ignore an entire directory. I have tried /i/Dir /iDir* /i/Dir/* and all continue to copy files from the directory. I am using the example above:

adbsync /hscu /s /v /iDir "e:\Nexus\sdcard\" "/mnt/shell/emulated/0"
2nd September 2013, 01:27 PM |#10  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Yes, currently the include/only options operate on file names, not paths.

I'll look into this...
The Following 2 Users Say Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
2nd September 2013, 06:24 PM |#11  
Pkt_Lnt's Avatar
Recognized Contributor
Flag SLO
Thanks Meter: 5,816
 
More
Thank you. It would be nice if a directory could be disabled. The one I have puts cache items with file names over 100 characters, and neither my win computer nor various cloud storage will take them. Wish I could still run linux, but alas, work software I need is win only.
Post Reply Subscribe to Thread

Tags
adb, sync, tool

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes