Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB push multiple files with the same extension with a single command

Tags:

android

push

adb

I want to push some files of the same type (.img) to the /sdcard partition of the phone with a single command. But the wildcard does not work:

adb push *.img /sdcard/ 

Is there any way I can achieve that?

like image 731
john Avatar asked Oct 15 '12 17:10

john


People also ask

How to push multiple files using adb push?

Copy the *. img files to an empty directory, then push the directory ( adb push /tmp/images /storage/sdcard0 ). adb will push all files in that directory to your designated location.

What does adb push mean?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.


2 Answers

Copy the *.img files to an empty directory, then push the directory (adb push /tmp/images /storage/sdcard0). adb will push all files in that directory to your designated location.

BTW, /sdcard as a path has been obsolete for quite some time, so please make sure you use a destination that exists and is supported by your device. Most Android 2.x/3.x/4.0 devices use /mnt/sdcard; Android 4.1 uses /storage/sdcard0.

like image 183
CommonsWare Avatar answered Oct 06 '22 00:10

CommonsWare


From my mind with echoing the file...

for i in *.img; do echo $i; adb push "$i" /sdcard/; done; 
like image 22
The Doctor Avatar answered Oct 05 '22 22:10

The Doctor