#!/bin/bash
#
-# android_install_app: installs the skia sampleApp on the device.
+# android_install_app: installs the Skia development apps on the device.
function print_usage {
- echo "USAGE: android_install_app [options]"
+ echo "USAGE: android_install_app [options] AppName"
echo " Options: -f Forces the package to be installed by removing any"
echo " previously installed packages"
echo " -h Prints this help message"
echo " --release Install the release build of Skia"
echo " -s [device_s/n] Serial number of the device to be used"
- echo " AppName Can be either sample_app or VisualBench"
+ echo " AppName Can be either SampleApp or VisualBench"
}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
done
if [[ ${app} == "" ]]; then
- echo "defaulting to installing sample_app."
- app="sample_app"
+ echo "Defaulting to installing SampleApp."
+ app="SampleApp"
fi
apk_suffix="debug.apk"
fi
+if [[ ${app} == 'SampleApp' ]]; then
+ app="sample_app"
+fi
APP_LC=$(echo $app | tr "[:upper:]" "[:lower:]")
app=${APP_ARGS[0]}
if [[ ${app} == '-'* ]]; then
+ echo "Defaulting to running SampleApp."
app="SampleApp"
APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
fi
if [[ ${app} == 'SampleApp' ]]; then
- $ADB ${DEVICE_SERIAL} shell am start -S -n "com.skia.sampleapp/com.skia.SkiaSampleActivity" --es "cmdLineFlags" "${APP_ARGS[*]:1}"
+ activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
elif [[ ${app} == "VisualBench" ]] ; then
- $ADB ${DEVICE_SERIAL} shell am start -S -n "com.skia.visualbench/com.skia.VisualBenchActivity" --es "cmdLineFlags" \"${APP_ARGS[*]:1}\"
+ activity="com.skia.visualbench/com.skia.VisualBenchActivity"
else
echo "ERROR: supports either 'SampleApp' or 'VisualBench' as valid apps"
+ exit 1
fi
-
+$ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${APP_ARGS[*]:1}\""