| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # android_install_skia: installs the skia apk on the device. | 3 # android_install_skia: installs the skia apk on the device. |
| 4 | 4 |
| 5 function print_usage { | 5 echo "The install step is now a no-op" |
| 6 echo "USAGE: android_install_skia [options]" | 6 exit; |
| 7 echo " Options: -f Forces the package to be installed by removing any
" | |
| 8 echo " previously installed packages" | |
| 9 echo " -h Prints this help message" | |
| 10 echo " --install-launcher Remounts the system partition and installs the" | |
| 11 echo " skia_launcher binary on the device" | |
| 12 echo " --release Install the release build of Skia" | |
| 13 echo " -s [device_s/n] Serial number of the device to be used" | |
| 14 } | |
| 15 | |
| 16 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| 17 | |
| 18 source $SCRIPT_DIR/utils/setup_adb.sh | |
| 19 source $SCRIPT_DIR/utils/setup_skia_out.sh | |
| 20 | |
| 21 forceRemoval="false" | |
| 22 installLauncher="false" | |
| 23 installOptions="-r" | |
| 24 configuration="Debug" | |
| 25 serialNumber="" | |
| 26 | |
| 27 while (( "$#" )); do | |
| 28 | |
| 29 if [[ "$1" == "-f" ]]; | |
| 30 then | |
| 31 forceRemoval="true" | |
| 32 elif [[ "$1" == "-h" ]]; | |
| 33 then | |
| 34 print_usage | |
| 35 exit | |
| 36 elif [[ "$1" == "--install-launcher" ]]; | |
| 37 then | |
| 38 installLauncher="true" | |
| 39 elif [[ "$1" == "-r" ]]; | |
| 40 then | |
| 41 echo "DEPRECATED: -r is now a no-op" | |
| 42 elif [[ "$1" == "--release" ]]; | |
| 43 then | |
| 44 configuration="Release" | |
| 45 elif [[ "$1" == "-s" ]]; | |
| 46 then | |
| 47 if [[ $# -lt 2 ]]; | |
| 48 then | |
| 49 echo "ERROR: missing serial number" | |
| 50 exit 1; | |
| 51 fi | |
| 52 serialNumber="-s $2" | |
| 53 shift | |
| 54 else | |
| 55 echo "ERROR: unrecognized option $1" | |
| 56 print_usage | |
| 57 exit 1; | |
| 58 fi | |
| 59 | |
| 60 shift | |
| 61 done | |
| 62 | |
| 63 if [[ "$forceRemoval" == "true" ]]; | |
| 64 then | |
| 65 echo "Forcing removal of previously installed packages" | |
| 66 $ADB ${serialNumber} uninstall com.skia > /dev/null | |
| 67 fi | |
| 68 | |
| 69 if [[ "$installLauncher" == "true" ]]; | |
| 70 then | |
| 71 echo "Installing skia_launcher binary" | |
| 72 $ADB ${serialNumber} root | |
| 73 $ADB ${serialNumber} remount | |
| 74 $ADB ${serialNumber} push ${SKIA_OUT}/${configuration}/skia_launcher /system
/bin | |
| 75 fi | |
| 76 | |
| 77 echo "Installing Skia App from ${SKIA_OUT}/${configuration}" | |
| 78 $ADB ${serialNumber} install ${installOptions} ${SKIA_OUT}/${configuration}/andr
oid/bin/SkiaAndroid.apk | |
| OLD | NEW |