diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-31 12:55:16 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-31 12:55:16 +0100 |
commit | 3b79c95b71e20f1124c8f785e793ae55d9309304 (patch) | |
tree | 478de5ea249fe5aabcc121560d351db87371dfc4 /android-proj.sh | |
parent | f2b11fd5485bef231a737eb6d94849e93e060290 (diff) | |
download | bin-3b79c95b71e20f1124c8f785e793ae55d9309304.zip bin-3b79c95b71e20f1124c8f785e793ae55d9309304.tar.gz |
add android-proj.sh
Diffstat (limited to 'android-proj.sh')
-rwxr-xr-x | android-proj.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/android-proj.sh b/android-proj.sh new file mode 100755 index 0000000..526725a --- /dev/null +++ b/android-proj.sh @@ -0,0 +1,40 @@ +#! /bin/bash + +if [ $# -lt 5 ]; then + echo "usage $0 ProjPath PackageName ProjName ActivityName TargetID" + exit 1 +fi + +PPATH=$1 +PKG=$2 +PNAME=$3 +ANAME=$4 +TARGET=$5 + +RESET="\033[0m" +RED="\033[0;31m" +BROWN="\033[0;33m" + +function run () +{ + echo -e "${RED}* ${BROWN}${1} ${RESET}" + $1 || exit 1 +} + +run "android create project --path ${PPATH} --target ${TARGET} --package ${PKG} --name ${PNAME} --activity ${ANAME}" +run "android create test-project --path ${PPATH}/tests --name ${PNAME}Test --main ../" + +run "cd $PPATH" +run "ant instrument" +run "ant instrument install" +#run "adb -s emulator-5554 install -r bin/${PNAME}-instrumented.apk" + +run "cd tests" +run "ant instrument" +run "ant instrument install" +#run "adb -s emulator-5554 install -r bin/${PNAME}Test-instrumented.apk" + +run "adb shell am instrument -e coverage true -w ${PKG}.tests/android.test.InstrumentationTestRunner" + +run "adb shell pm uninstall ${PKG}" +run "adb shell pm uninstall ${PKG}.tests" |