skia2/platform_tools/android/bin/android_launch_app
kkinnunen 4c7040bf8a SampleApp: Make android_install_app and android_launch_app work consistently
Make android_install_app work more consistently:
* App can be "SampleApp" or "VisualBench"

Make android_launch_app work more consistently:
* Parameters to SampleApp are passed correctly
* SampleApp is actually launched

The parameters to "am" need to be quoted, since the command
is run on the device shell.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1589883002

Review URL: https://codereview.chromium.org/1589883002
2016-01-14 06:07:40 -08:00

31 lines
960 B
Bash
Executable File

#!/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
echo "Defaulting to running SampleApp."
app="SampleApp"
APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
fi
if [[ ${app} == 'SampleApp' ]]; then
activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
elif [[ ${app} == "VisualBench" ]] ; then
activity="com.skia.visualbench/com.skia.VisualBenchActivity"
else
echo "ERROR: supports either 'SampleApp' or 'VisualBench' as valid apps"
exit 1
fi
$ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${APP_ARGS[*]:1}\""