adb-sync


Source link: https://github.com/google/adb-sync

adb-sync

adb-sync is a tool to synchronize files between a PC and an Android device using the ADB (Android Debug Bridge).

Related Projects

Before getting used to this, please review this list of projects that are somehow related to adb-sync and may fulfill your needs better:

  • rsync is a file synchronization tool for local (including FUSE) file systems or SSH connections. This can be used even with Android devices if rooted or using an app like SSHelper.
  • adbfs is a FUSE file system that uses adb to communicate to the device. Requires a rooted device, though.
  • adbfs-rootless is a fork of adbfs that requires no root on the device. Does not play very well with rsync.
  • go-mtpfs is a FUSE file system to connect to Android devices via MTP. Due to MTP's restrictions, only a certain set of file extensions is supported. To store unsupported files, just add .txt! Requires no USB debugging mode.

Setup

Android Side

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:

  • Go to the Settings app.
  • If there is no "Developer Options" menu:
    • Select "About".
    • Tap "Build Number" seven times.
    • Go back.
  • Go to "Developer Options".
  • Enable "USB Debugging".

PC Side

  • Install the Android SDK (the stand-alone Android SDK "for an existing IDE" is sufficient). Alternatively, some Linux distributions come with a package named like "android-tools-adb" that contains the required tool.
  • Make sure "adb" is 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
  • cd adb-sync
  • Copy or symlink the adb-sync script somewhere in your PATH. For example: cp adb-sync /usr/local/bin/

Usage

To get a full help, type:

adb-sync --help 

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 

ADB Channel

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 (intall SSHelper first) using a configuration like:

Host sshhelper Port 2222 ProxyCommand adb-channel tcp:%p com.arachnoid.sshelper/.SSHelperActivity 1 

After adding this to ~/.ssh/config, run ssh-copy-id sshhelper.

Congratulations! You can now use rsync, sshfs etc. to the host name sshhelper.

Contributing

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:

Disclaimer

This is not an official Google product.

Resources

WiFi Utils is a library that provides a set of convenience methods for managing WiFi State, WiFi Scan, and WiFi Connection to Hotspots. If you have ever worked with WifiManager you should know how painful it is to make a simple wifi network scan or even worse to connect to a hotspot programmatically. So that's what my new library is all about. To make it easier for me and hopefully for other developers as well to do those kind of tasks from Java code.

Scaling layout just like in Blinkist and Spotify app.

MaterialTabsTemplate is solely created to reduce the burden of writing same boiler plate codes for Tab creation in Android.

Pretty print the result of Android lint tool. Would work great when you run lint as part of continuous integration flow.

This lib provides simple and fluent API for creating Android Spannable.

An android library containing most of the helper classes every android developer needs.

The Problem

Every Android developer faces few problems while developing Android Apps. Listing down some of them, which I have faced everytime I create a new android project.

  1. The problem of writing boilerplate code while creating Activities, Fragments is annoying.
  2. Need of readymade methods which can come handy such as showing a toast, or showing a progress dialog or launching a new activity.
  3. The problem of applying proper styles and themes to activities and handling those for pre-lollipop and post-lollipop.

What if we had a library which takes care of all these problems and let the developers concentrate on writing the actual business logic and create awesome functionalities.

The Solution

Using the Helper library developer can solve the above mentioned problems. Using this Helper library is pretty simple.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes