skia2/platform_tools/android/bin/android_install_app
Derek Sollenberger dc71e152ef Update Android Apps to work with GN.
This also includes the removal of an old example whose instructions
are not compatible with GN.

BUG=skia:6009

Change-Id: I2807829ca12c19292ae0f5a7ea250ed453f9a182
Reviewed-on: https://skia-review.googlesource.com/5620
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-04 19:38:34 +00:00

44 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
#
# android_install_app: installs the Skia development apps on the device.
function print_usage {
echo "USAGE: android_install_app [options]"
echo " Options: -f Forces the package to be installed by removing any"
echo " previously installed packages"
echo " -h Prints this help message"
echo " -s [device_s/n] Serial number of the device to be used"
}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/utils/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh
forceRemoval="false"
for arg in ${APP_ARGS[@]}; do
if [[ "${arg}" == "-f" ]]; then
forceRemoval="true"
elif [[ "${arg}" == "-h" ]]; then
print_usage
exit
elif [[ ${arg} == '-'* ]]; then
echo "ERROR: unrecognized option ${arg}"
print_usage
exit 1;
fi
done
APP_LC=$(echo Viewer | tr "[:upper:]" "[:lower:]")
if [[ "$forceRemoval" == "true" ]];
then
echo "Forcing removal of previously installed packages"
$ADB ${DEVICE_SERIAL} uninstall org.skia.${APP_LC} > /dev/null
fi
echo "Installing ${APP_LC} from ${SKIA_OUT}/${APP_LC}.apk"
$ADB ${DEVICE_SERIAL} install -r ${SKIA_OUT}/${APP_LC}.apk