2013-08-12 12:30:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# android_install_skia: installs the skia apk on the device.
|
|
|
|
|
|
|
|
function print_usage {
|
|
|
|
echo "USAGE: android_install_skia [options]"
|
|
|
|
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"
|
|
|
|
configuration="Debug"
|
|
|
|
|
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"
|
2013-11-06 15:01:37 +00:00
|
|
|
elif [[ "${arg}" == "--release" ]];
|
|
|
|
then
|
2013-08-12 12:30:04 +00:00
|
|
|
configuration="Release"
|
|
|
|
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
|
|
|
|
|
|
|
|
echo "Installing Skia App from ${SKIA_OUT}/${configuration}"
|
|
|
|
$ADB ${DEVICE_SERIAL} install ${installOptions} ${SKIA_OUT}/${configuration}/android/bin/SkiaAndroid.apk
|