2013-08-12 12:30:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2015-02-03 23:07:30 +00:00
|
|
|
# android_install_app: installs the skia sampleApp on the device.
|
2013-08-12 12:30:04 +00:00
|
|
|
|
|
|
|
function print_usage {
|
2015-02-03 23:07:30 +00:00
|
|
|
echo "USAGE: android_install_app [options]"
|
2013-08-12 12:30:04 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2013-08-20 12:22:57 +00:00
|
|
|
source $SCRIPT_DIR/android_setup.sh
|
2013-08-12 12:30:04 +00:00
|
|
|
source $SCRIPT_DIR/utils/setup_adb.sh
|
|
|
|
|
|
|
|
forceRemoval="false"
|
|
|
|
installLauncher="false"
|
|
|
|
installOptions="-r"
|
|
|
|
|
2013-11-06 15:01:37 +00:00
|
|
|
for arg in ${APP_ARGS[@]}
|
|
|
|
do
|
|
|
|
if [[ "${arg}" == "-f" ]];
|
2013-08-12 12:30:04 +00:00
|
|
|
then
|
|
|
|
forceRemoval="true"
|
2013-11-06 15:01:37 +00:00
|
|
|
elif [[ "${arg}" == "-h" ]];
|
2013-08-12 12:30:04 +00:00
|
|
|
then
|
|
|
|
print_usage
|
|
|
|
exit
|
2013-11-06 15:01:37 +00:00
|
|
|
elif [[ "${arg}" == "-r" ]];
|
2013-08-12 12:30:04 +00:00
|
|
|
then
|
|
|
|
echo "DEPRECATED: -r is now a no-op"
|
|
|
|
else
|
2013-11-06 15:01:37 +00:00
|
|
|
echo "ERROR: unrecognized option ${arg}"
|
2013-08-12 12:30:04 +00:00
|
|
|
print_usage
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ "$forceRemoval" == "true" ]];
|
|
|
|
then
|
|
|
|
echo "Forcing removal of previously installed packages"
|
|
|
|
$ADB ${DEVICE_SERIAL} uninstall com.skia > /dev/null
|
|
|
|
fi
|
|
|
|
|
2014-05-06 18:29:28 +00:00
|
|
|
echo "Installing Skia App from ${SKIA_OUT}/${BUILDTYPE}"
|
|
|
|
$ADB ${DEVICE_SERIAL} install ${installOptions} ${SKIA_OUT}/${BUILDTYPE}/android/bin/SkiaAndroid.apk
|