skia2/platform_tools/android/bin/android_launch_app

29 lines
957 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# android_launch_app: Launches the skia sampleApp on the device.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh
# TODO: check to ensure that the app exists on the device and prompt to install
if [[ -n $RESOURCE_PATH ]]; then
adb_push_if_needed "${SKIA_SRC_DIR}/resources" $RESOURCE_PATH
fi
app=${APP_ARGS[0]}
if [[ ${app} == '-'* ]]; then
app="SampleApp"
APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
fi
if [[ ${app} == 'SampleApp' ]]; then
$ADB ${DEVICE_SERIAL} shell am start -S -n "com.skia.sampleapp/com.skia.SkiaSampleActivity" --es "cmdLineFlags" "${APP_ARGS[*]:1}"
elif [[ ${app} == "VisualBench" ]] ; then
$ADB ${DEVICE_SERIAL} shell am start -S -n "com.skia.visualbench/com.skia.VisualBenchActivity" --es "cmdLineFlags" \"${APP_ARGS[*]:1}\"
else
echo "ERROR: supports either 'SampleApp' or 'VisualBench' as valid apps"
fi