| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # android_launch_app: Launches the skia sampleApp on the device. | 3 # android_launch_app: Launches the skia Viewer app on the device. |
| 4 | 4 |
| 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 6 source $SCRIPT_DIR/android_setup.sh | 6 source $SCRIPT_DIR/android_setup.sh |
| 7 source $SCRIPT_DIR/utils/setup_adb.sh | 7 source $SCRIPT_DIR/utils/setup_adb.sh |
| 8 | 8 |
| 9 # TODO: check to ensure that the app exists on the device and prompt to install | 9 # TODO: check to ensure that the app exists on the device and prompt to install |
| 10 | 10 |
| 11 if [[ -n $RESOURCE_PATH ]]; then | 11 if [[ -n $RESOURCE_PATH ]]; then |
| 12 adb_push_if_needed "${SKIA_SRC_DIR}/resources" $RESOURCE_PATH | 12 adb_push_if_needed "${SKIA_SRC_DIR}/resources" $RESOURCE_PATH |
| 13 fi | 13 fi |
| 14 | 14 |
| 15 app=${APP_ARGS[0]} | 15 activity="org.skia.viewer/org.skia.viewer.ViewerActivity" |
| 16 if [[ ${app} == '-'* ]]; then | |
| 17 echo "Defaulting to running SampleApp." | |
| 18 app="SampleApp" | |
| 19 APP_ARGS=( "SampleApp" ${APP_ARGS[*]} ) | |
| 20 fi | |
| 21 | |
| 22 if [[ ${app} == 'SampleApp' ]]; then | |
| 23 activity="com.skia.sample_app/com.skia.SkiaSampleActivity" | |
| 24 elif [[ ${app} == "Viewer" ]] ; then | |
| 25 activity="org.skia.viewer/org.skia.viewer.ViewerActivity" | |
| 26 else | |
| 27 echo "ERROR: supports either 'SampleApp' or 'Viewer' as valid apps" | |
| 28 exit 1 | |
| 29 fi | |
| 30 $ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${AP
P_ARGS[*]:1}\"" | 16 $ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${AP
P_ARGS[*]:1}\"" |
| OLD | NEW |