If I have a folder structure in my computer such as A\B and the B subfolder contains 5 files, if I issue the command
adb push c:\programs\A\*.* /sdcard/fooBar
it copies all the 5 files inside the B subfolder into /sdcard/fooBar
How do I copy the entire subfolder B into the android device so that the fodler structure inside the device looks like /sdcard/fooBar/B/5-files
?
Don't use \*.*
may be ok
adb push c:\programs\A\ /sdcard/fooBar/
adb push c:\programs\A\B /sdcard/fooBar/B
I've struggled with this question myself and it is clear that both answers do not actually answer the question.
To adb push
to the SD Card, do not use /sdcard
; that's your internal storage!
To push to your SD Card, first, you need to drop to adb shell
in order to find it.
❯ adb shell
phoenix_sprout:/ $
Once in the shell, let's find it.
phoenix_sprout:/ $ cd storage
phoenix_sprout:/storage $ ls
C1ED-8A74 emulated self
On that phone, the SD Card is at /storage/C1ED-8A74
.
phoenix_sprout:/storage $ cd C1ED-8A74/
phoenix_sprout:/storage/C1ED-8A74 $ ls
Alarms Audiobooks Documents Movies Notifications Podcasts UI
Android DCIM Download Music Pictures Ringtones
You can verify that this is the SD Card by checking the folder's content and matching it with what's on your phone's file manager.
Now you can exit from the adb shell
and push stuff.
adb push A /storage/C1ED-8A74/
Congrats! You've now got A
and its subfolders in your SD Card.
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