2015-05-11 12:54:19 +00:00
|
|
|
#!/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
|
|
|
|
|
2015-06-22 12:39:32 +00:00
|
|
|
app=${APP_ARGS[0]}
|
|
|
|
if [[ ${app} == '-'* ]]; then
|
2016-01-14 14:07:40 +00:00
|
|
|
echo "Defaulting to running SampleApp."
|
2015-06-22 12:39:32 +00:00
|
|
|
app="SampleApp"
|
|
|
|
APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ${app} == 'SampleApp' ]]; then
|
2016-01-14 14:07:40 +00:00
|
|
|
activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
|
2016-06-02 18:44:06 +00:00
|
|
|
elif [[ ${app} == "Viewer" ]] ; then
|
2016-05-27 12:39:29 +00:00
|
|
|
activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
|
2015-06-22 12:39:32 +00:00
|
|
|
else
|
2016-05-27 12:39:29 +00:00
|
|
|
echo "ERROR: supports either 'SampleApp' or 'Viewer' as valid apps"
|
2016-01-14 14:07:40 +00:00
|
|
|
exit 1
|
2015-06-22 12:39:32 +00:00
|
|
|
fi
|
2016-01-14 14:07:40 +00:00
|
|
|
$ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${APP_ARGS[*]:1}\""
|