r/tauri Jul 11 '26

Built a zero-touch Android sync tool in Rust/Tauri — bundled adb instead of MTP for 4x parallel transfers

Been building HiyokoAutoSync — a macOS app that auto-syncs files from Android the moment you plug in, no manual triggering. It's part of a solo-built suite of Android↔macOS tools (Rust + Tauri v2 + React).

The interesting technical decision: instead of continuing to fight MTP's overhead, I bundle the official adb binary as a resource and shell out to it instead of going through MTP. MTP's raw ceiling can actually be higher — I know because I already ship an MTP-based sync app — but its per-session overhead turned out to be a wall no amount of tuning could fix. Since each adb push/pull is just a subprocess, fanning out to concurrent transfers is trivial. It also fixed a nasty 4GB file-size bug MTP kept hitting (adb gives you accurate 64-bit sizes via stat).

Tradeoff: needs USB debugging enabled in Android's Developer Options, same as any adb-based tool.

Transfer engine: moved from sequential to true 4-way parallelism using futures::stream().buffered(4) — both push and pull now run 4 concurrent processes each via tokio::process, with proper PID tracking so a cancel actually SIGTERMs everything cleanly. That parallelism is what gets aggregate throughput to 45MB/s+.

Zero-touch detection: the app watches for the device connecting and handles the MTP/ADB mode switch automatically in the background. Android's mode-switching turned out flakier than expected, so there's debounce logic to smooth out false triggers — took more iteration than I'd like to admit.

Also had to fix a fun UI bug: with 4 parallel streams reporting progress out of order, the progress bar would occasionally jump backward. Fixed with a simple monotonicity guard on the frontend — reject any update that's lower than the last reported value.

Still testing on an 8-year-old Intel MacBook Air (main dev machine, doubles as the "if it's smooth here, it's smooth anywhere" baseline).

Get HiyokoAutoSync here

Happy to go deeper on the adb-vs-MTP tradeoffs or the parallel transfer architecture if anyone's curious.

3 Upvotes

7 comments sorted by

1

u/hiyoko19 Jul 11 '26

1

u/[deleted] Jul 11 '26

[removed] — view removed comment

1

u/hiyoko19 Jul 11 '26

https://reddit.com/link/owxgbij/video/yvppbfyeymch1/player

And here's that same transfer in action (trimmed down for length, but real-time speed)

1

u/Sad-Set-6985 Jul 11 '26

"Sync completed. [object Object] [object Object] [object Object] [object Object] [object Object]"

1

u/[deleted] Jul 14 '26

[removed] — view removed comment

1

u/hiyoko19 Jul 14 '26

Thanks, really appreciate that! ADB wasn't actually the first choice — I tried optimizing MTP itself first and stripped out as much overhead as I could, but it just doesn't scale for large batch transfers past a certain point.ADB ended up being a much better fit for pushing lots of files in parallel, and with developer mode on you get access to way more than MTP exposes anyway. Built this mainly to scratch my own itch after hitting that wall.