skia2/platform_tools/android/bin/android_install_skia
djsollen@google.com dcdd57faf0 Copy the top level Android directory into trunk.
This CL is the first step in a series needed to move the
android directory into trunk. After the copy we will update
GYP and DEPS to point to the new location and only then
remove the original directory.

git-svn-id: http://skia.googlecode.com/svn/trunk@8891 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-29 12:09:31 +00:00

79 lines
2.0 KiB
Bash
Executable File

#!/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 " --install-launcher Remounts the system partition and installs the"
echo " skia_launcher binary on the device"
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 )"
source $SCRIPT_DIR/utils/setup_adb.sh
source $SCRIPT_DIR/utils/setup_skia_out.sh
forceRemoval="false"
installLauncher="false"
installOptions="-r"
configuration="Debug"
serialNumber=""
while (( "$#" )); do
if [[ "$1" == "-f" ]];
then
forceRemoval="true"
elif [[ "$1" == "-h" ]];
then
print_usage
exit
elif [[ "$1" == "--install-launcher" ]];
then
installLauncher="true"
elif [[ "$1" == "-r" ]];
then
echo "DEPRECATED: -r is now a no-op"
elif [[ "$1" == "--release" ]];
then
configuration="Release"
elif [[ "$1" == "-s" ]];
then
if [[ $# -lt 2 ]];
then
echo "ERROR: missing serial number"
exit 1;
fi
serialNumber="-s $2"
shift
else
echo "ERROR: unrecognized option $1"
print_usage
exit 1;
fi
shift
done
if [[ "$forceRemoval" == "true" ]];
then
echo "Forcing removal of previously installed packages"
$ADB ${serialNumber} uninstall com.skia > /dev/null
fi
if [[ "$installLauncher" == "true" ]];
then
echo "Installing skia_launcher binary"
$ADB ${serialNumber} root
$ADB ${serialNumber} remount
$ADB ${serialNumber} push ${SKIA_OUT}/${configuration}/skia_launcher /system/bin
fi
echo "Installing Skia App from ${SKIA_OUT}/${configuration}"
$ADB ${serialNumber} install ${installOptions} ${SKIA_OUT}/${configuration}/android/bin/SkiaAndroid.apk