8371e704b7
(SkipBuildbotRuns) R=djsollen@google.com Review URL: https://codereview.chromium.org/15199005 git-svn-id: http://skia.googlecode.com/svn/trunk@9167 2bbb7eff-a529-9590-31e7-b0007b416f81
49 lines
1005 B
Bash
Executable File
49 lines
1005 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# android_run_skia: starts the correct skia program on the device, prints the
|
|
# output, and kills the app if interrupted.
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
source $SCRIPT_DIR/utils/setup_adb.sh
|
|
|
|
APP_ARGS=""
|
|
USE_INTENT="false"
|
|
SERIAL=""
|
|
|
|
while (( "$#" )); do
|
|
|
|
if [[ "$1" == "--intent" ]];
|
|
then
|
|
USE_INTENT="true"
|
|
elif [[ "$1" == "-s" ]];
|
|
then
|
|
if [[ $# -lt 2 ]];
|
|
then
|
|
echo "ERROR: missing serial number"
|
|
exit 1;
|
|
fi
|
|
SERIAL="-s $2"
|
|
shift
|
|
else
|
|
APP_ARGS="$APP_ARGS $1"
|
|
fi
|
|
|
|
shift
|
|
done
|
|
|
|
|
|
if [[ "$USE_INTENT" == "true" ]];
|
|
then
|
|
$ADB $SERIAL logcat -c
|
|
$ADB $SERIAL shell am broadcast -a com.skia.intent.action.LAUNCH_SKIA -n com.skia/.SkiaReceiver -e args "$APP_ARGS"
|
|
trap "echo \"Interrupt.\"" INT
|
|
eval "($ADB $SERIAL logcat)"
|
|
trap - INT
|
|
echo "Interrupt. Killing Skia process..."
|
|
$SCRIPT_DIR/android_kill_skia $SERIAL
|
|
echo "Done."
|
|
else
|
|
$ADB $SERIAL shell skia_launcher $APP_ARGS
|
|
fi
|