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

Mots clés : androidpushadbandroid

meilleur 4 Réponses android - ADB push multiple files with the same extension with a single command

vote vote

97

for i in *.img; do echo $i; adb push "$i" /sdcard/; done; 
vote vote

88

for %i in (*.img) do adb push %i /sdcard/folderName/%i 
 for %%i in (*.img) do adb push %%i /sdcard/folderName/%%i 
for f in *.img; do adb push $f /sdcard/folderName/$f; done 
vote vote

75

find *.img -exec adb push {} /storage/sdcard0 \; 
vote vote

66

#D=echo D= S= if [ $1 == "-s" ]; then     S="-s $2"     shift     shift fi if [ $# -lt 2 ]; then     echo "Usage: $0 directory files..." else DIR=$1 shift for f in $* do   #echo "Processing $DIR/$f file..."   echo ~/aspt/adb ${S} push "$f" "$DIR/$f"   ${D} ~/aspt/adb ${S} push "$f" "$DIR/$f" done fi 
mpush /sdcard/ libMyLib.so mpush /sdcard/ libFirst.so libSecond.so mpush /sdcard/ * mpush -s 109d8a6fe0678a3 /sdcard/ * 
D=echo #D= 
#D=echo D= S= if [ $1 == "-2all" -o $1 == "-all" ]; then   shift   DEVICES=`~/aspt/adb devices | tail -n +2 | awk '{print $1}'`   if [ $# -lt 2 ]; then       echo "Usage: $0 [options] directory files..."       echo "Options:"       echo "-s device-id -- push to the specified device"       echo "-all or -2all -- push to all devices"   else     DIR=$1     shift     for d in $DEVICES     do       for f in $*       do     #echo "Processing $DIR/$f file..."     echo ~/aspt/adb -s $d push "$f" "$DIR/$f"     ${D} ~/aspt/adb -s $d push "$f" "$DIR/$f"       done     done   fi else   if [ $1 == "-s" ]; then       S="-s $2"       shift       shift   fi   if [ $# -lt 2 ]; then       echo "Usage: $0 [options] directory files..."       echo "Options:"       echo "-s device-id -- push to the specified device"       echo "-all or -2all -- push to all devices"   else     DIR=$1     shift     for f in $*     do       #echo "Processing $DIR/$f file..."       echo ~/aspt/adb ${S} push "$f" "$DIR/$f"       ${D} ~/aspt/adb ${S} push "$f" "$DIR/$f"     done   fi fi 

Questions similaires