1. mizike123's Avatar
    Hi, so I am new to the forums here.

    Anyway, I downloaded the SWM for OSX and it worked just great. (Thanks!)
    However, my only complaint is that you are limited to installing one application at a time with the SWM scripts.

    So..I decided to create my own script that automated the installation process for multiple apps at one time. (FYI, I am pretty new scripting/programming but this does work but it is nothing fancy.)

    Hopefully someone else will find this somewhat useful!

    Basically:

    Copy the code. (located below)

    Code:
    #!/bin/bash
    
    typeset -i APP_COUNT=0
    APP_COUNT=$(ls -l ./2-Place-App-Here/*.apk | wc -l)
    
    tput clear
    echo "This will install a directory of android apps at once."
    echo "The number of apps to be installed is: $APP_COUNT"
    echo "Press the Enter key when you are ready to begin the process.."
    read enterKey
    
    ls -1 ./2-Place-App-Here/ | grep .apk > files_to_install
    
    
    for (( c=1; c<=$APP_COUNT; c++ ))
    do
    
    APP_INSTALL_NAME=$(sed -n "$c p" files_to_install)
    echo "Attempting to install: $APP_INSTALL_NAME"
    sleep 1
    sudo ./adb install 2-Place-App-Here/$APP_INSTALL_NAME
    
    done
    
    wait
    
    rm -f files_to_install
    echo "Installation of applications completed"
    echo "Exiting Now..."
    
    exit 0;

    Open textedit and paste the script.
    Save into the directory with adb in it.
    Copy all of your apps you wish to install into the '2-Place-App-Here' folder.
    Open terminal and navigate to the swm folder where you saved the script file.
    - type: chmod u+x whatever-name-you-saved-the-script-as
    - type ./whatever-name-you-saved-the-script-as
    You will then ask you for your password for the machine for superuser privileges needed to run adb.
    Let the script run until finished.




    *** Note:

    Just like the SWM script, You will need to strip the spaces from the apps you wish to load on your android!! =)
    You can achieve this manually or by putting this script into the "2-Place-App-Here" folder and running it there.

    Code:
    #! /bin/sh
    
    for n in *
    do
    OldName=$n
    NewName=`echo $n | tr -d " "`
    #NewName=`echo $n | tr -s " " "_"`
    echo $NewName
    mv "$OldName" "$NewName"
    done
    04-14-2011 08:27 PM
LINK TO POST COPIED TO CLIPBOARD