I am wondering if there is a way to install and run an android application on multiple devices/emulator with a single click under Eclipse.
When I am testing a layout on
I just finished the script Aleadam advice me to do.
A simple loop on each device connected to the computer with install and start.
Script andinstall:
#!/bin/bash
if [ $# -lt 3 ] ;then
echo "usage $0 pathToTheFileToInstall packagename fullPackageActivityName"
exit 1
fi
FILEPATH=$1
PACKAGE=$2
ACTIVITYNAME=$3
APK=`ls $FILEPATH/*.apk`
installOnSingleDevice(){
echo "Installing on $DEVICE -------"
echo "adb -s $1 install -r $APK"
adb -s $1 install -r $APK
echo "adb -s $1 shell am start -n $2/$3"
adb -s $1 shell am start -n $2/$3
echo "--------------------------"
}
if [ $? -eq 0 ] ;then
adb devices | grep device | grep -v attached | cut -f 1 > tmpfile
while read line;
do
installOnSingleDevice $line $PACKAGE $ACTIVITYNAME&
done < tmpfile
rm tmpfile
else
echo "No apk at this path (${FILEPATH})"
fi
Usage example:
andinstall ~/workspace/myapp/bin/ fr.openium.myapp fr.openium.myapp.activity.ActivitySplash