Skip to content

bczhc/adb-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adb-sync

Usage

Note: The supported Android version is Android 7.0 Nougat (API Version 24) and above, because it depends on ifaddrs which is supported officially only above this version.

Build

  • Set up Rust with NDK toolchain

    An example configuration file:

    # <project>/.cargo/config
    
    [build]
    [target.aarch64-linux-android]
    linker = "/home/bczhc/bin/AndroidSdk/ndk-ln/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang"
    ar = "/home/bczhc/bin/AndroidSdk/ndk-ln/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
    
    [env]
    TARGET_CC = "/home/bczhc/bin/AndroidSdk/ndk-ln/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang"
    TARGET_AR = "/home/bczhc/bin/AndroidSdk/ndk-ln/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
  • Install Android targets using rustup:

    rustup target add aarch64-linux-android

    If your Android architecture is not aarch64, choose some others (also change $android_target in ./build-rust correspondingly):

    • aarch64-linux-android
    • armv7-linux-androideabi
    • i686-linux-android
    • x86_64-linux-android
  • Run ./build-rust

Run

After ./build-rust, run:

./adb-sync

Limitations and Notes

  • Relies on mtimes
  • No multiple files/directories and file exclusion support
  • Empty directories won't be synced
  • Only supports regular files (that's, totally ignores symlink, pipe etc.; no reflink or hard link awareness)

I've found project https://github.com/google/adb-sync and https://github.com/jb2170/better-adb-sync, but their sync speed is quite slow; can't fulfill my personal requirements :).

Script implementation

For the initial script implementation, see script-impl branch.

For syncing over network, see https://github.com/bczhc/FileSync

About

Sync Android files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published