aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin/android_install_app
blob: b43b77d69eb29ab934a0cd12cef4005538f3d1a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# android_install_app: installs the skia sampleApp 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 "            --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/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh

forceRemoval="false"
installLauncher="false"
installOptions="-r"

for arg in ${APP_ARGS[@]}
do
  if [[ "${arg}" == "-f" ]];
  then
    forceRemoval="true"
  elif [[ "${arg}" == "-h" ]];
  then
    print_usage
    exit
  elif [[ "${arg}" == "-r" ]];
  then
    echo "DEPRECATED: -r is now a no-op"
  else
    echo "ERROR: unrecognized option ${arg}"
    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}/${BUILDTYPE}"
$ADB ${DEVICE_SERIAL} install ${installOptions} ${SKIA_OUT}/${BUILDTYPE}/android/bin/SkiaAndroid.apk