I think adb's push is file-based. I want to be able to push entire folders. Is there an easy way without scripting?
Thanks!
Edit: I need to work with sub-folders.
Edit: Seems that adb pull is recursive but push is not. So I changed the title and description accordingly.
Using adb push overwrites every existent file and thus takes ages to finish. adb sync does only push the file if it exists on the phone AND contains other data than the local version.
Push a file to your Android deviceThe format starts with the command adb push, then adds the local location of the file and the location on device you want to save to. To keep it absolutely simple, let's just put that video file back on the device. Hit enter, of course, and watch your files fly.
Try this (worked with subfolders): adb push mySourceFolder/. myDestAndroidFolder
.
Empty folders do not copy to android device.
I'm gonna dig this even more to give a full solution to this (for linux only), because google redirect to this and I had this exact same problem.
With a simple adb push, the problem is that all the subdirectories must exist BEFORE doing the push, which can be very painful to achieve.
Note that an easy solution is to zip the folder, push the zip then unzip on the device. But let's say you don't have unzip on your device (highly unlikely, really).
You want to push a full tree with a lot of subdirectories to your device in an empty directory myDirectory. There are two steps :
First create all the subdirectories, in your source device:
cd <folder-containing-myDirectory> find myDirectory/ -type d -exec adb shell mkdir <path-to-folder-containing-myDirectory-in-device>/{} \;
This command find all the subdirectories of myDirectory (including ., so if myDirectory already exists, you will have one error message you can safely ignore) and for each of them, create the matching directory on the device.
then push everything
adb push myDirectory/. <path-to-folder>/myDirectory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With