Created
May 16, 2013 21:12
-
-
Save anonymous/5595148 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ folder="bin/classes/" package="$1" inotifywait -m -q -e close_write "$folder" | while read f; do # take only the filename f=`awk '{print $3}' <<< "$f"` # rebuild the full path path="$folder$f" # if it's not an apk or is the unaligned one, skip it if [[ $f =~ ^.*unaligned\.apk$ || ! $f =~ ^.*apk$ ]]; then echo "Skipping $f" continue; fi # Get the list of device names. This ignores whether they're online or not. devices=`adb devices | sed '1d' | awk '{print $1;}'` echo "Sending $f.." echo "$devices" | (parallel adb -s {} install -r "$path" | sed 's/^/ /') 2> /dev/null echo "done" # If we provided an activity name, start it on all devices if [ $package ]; then echo "Starting activity $package.." echo "$devices" | (parallel adb -s {} shell am start "$package" | sed 's/^/ /') 2> /dev/null echo "done" fi done