Using adb, we can push files or folders. But how can I push a folder ("Music" for example) into my /sdcard/
that already contains this folder to add just the new files within Music on my computer ? It takes a lot of time to push the entire folder each time I want to add music.
-
I don't know how with ADB , but you can see an alternative here– beeshyamsCommented Jan 29, 2018 at 13:41
-
See if this helps: adb push only if file doesn't exist or has changed and How to pull only newer files with “adb pull”? (Android SDK utility)– xavier_fakeratCommented Jan 30, 2018 at 16:47
1 Answer
Perhaps your best bet is using an alternative tool: adb-sync.
adb-sync is a tool to synchronize files between a PC and an Android device using the ADB (Android Debug Bridge).
Setup
Android
- basically you need to allow USB debugging.
PC
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
Additionally you can play around with flags in defined in the help section to get the desired result.
Acknowledgements
-
adb-sync is all written and requires python 3.6+, which made it a no go for me– ryeagerCommented May 7, 2019 at 21:48