OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_run_skia: starts the correct skia program on the device, prints the | 3 # android_run_skia: starts the correct skia program on the device, prints the |
4 # output, and kills the app if interrupted. | 4 # output, and kills the app if interrupted. |
5 | 5 |
6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
7 source $SCRIPT_DIR/android_setup.sh | 7 source $SCRIPT_DIR/android_setup.sh |
8 source $SCRIPT_DIR/utils/setup_adb.sh | 8 source $SCRIPT_DIR/utils/setup_adb.sh |
9 | 9 |
10 if [ ! -f "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" ]; | 10 if [ ! -f "${SKIA_OUT}/$BUILDTYPE/lib/lib${APP_ARGS[0]}.so" ]; |
(...skipping 17 matching lines...) Expand all Loading... |
28 if [ $LOGCAT ]; then | 28 if [ $LOGCAT ]; then |
29 verbose "clearing the device logs..." | 29 verbose "clearing the device logs..." |
30 $ADB $DEVICE_SERIAL logcat -c; | 30 $ADB $DEVICE_SERIAL logcat -c; |
31 fi | 31 fi |
32 STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)" | 32 STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)" |
33 CMD_FILENAME=".skia_cmd_tmp_$(date +%s%N)" | 33 CMD_FILENAME=".skia_cmd_tmp_$(date +%s%N)" |
34 echo "LD_LIBRARY_PATH=/data/local/tmp:$LD_LIBRARY_PATH \ | 34 echo "LD_LIBRARY_PATH=/data/local/tmp:$LD_LIBRARY_PATH \ |
35 /data/local/tmp/skia_launcher ${APP_ARGS[*]}; \ | 35 /data/local/tmp/skia_launcher ${APP_ARGS[*]}; \ |
36 echo \$? > ${STATUS_FILENAME}" > ${CMD_FILENAME} | 36 echo \$? > ${STATUS_FILENAME}" > ${CMD_FILENAME} |
37 chmod +x ${CMD_FILENAME} | 37 chmod +x ${CMD_FILENAME} |
| 38 verbose "======== To reproduce this run: ========" |
| 39 verbose "android_run_skia ${APP_ARGS[*]}" |
| 40 verbose "========================================" |
38 verbose "pushing command file onto the device..." | 41 verbose "pushing command file onto the device..." |
39 $ADB ${DEVICE_SERIAL} push ${CMD_FILENAME} /data/local/tmp | 42 $ADB ${DEVICE_SERIAL} push ${CMD_FILENAME} /data/local/tmp |
40 rm ${CMD_FILENAME} | 43 rm ${CMD_FILENAME} |
41 verbose "preparing to run ${APP_ARGS[0]} on the device..." | 44 verbose "preparing to run ${APP_ARGS[0]} on the device..." |
42 $ADB ${DEVICE_SERIAL} shell sh /data/local/tmp/${CMD_FILENAME} | 45 $ADB ${DEVICE_SERIAL} shell sh /data/local/tmp/${CMD_FILENAME} |
43 | 46 |
44 if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exis
ts; fi')" ]; then | 47 if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exis
ts; fi')" ]; then |
45 if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi | 48 if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi |
46 echo "***********************************************************************" | 49 echo "***********************************************************************" |
47 echo "The application terminated unexpectedly and did not produce an exit code
" | 50 echo "The application terminated unexpectedly and did not produce an exit code
" |
(...skipping 12 matching lines...) Expand all Loading... |
60 echo "***********************************************************************" | 63 echo "***********************************************************************" |
61 exit 1 | 64 exit 1 |
62 fi | 65 fi |
63 | 66 |
64 echo "EXIT_CODE is ${EXIT_CODE}" | 67 echo "EXIT_CODE is ${EXIT_CODE}" |
65 if [ $'0\r' != "${EXIT_CODE}" ]; then | 68 if [ $'0\r' != "${EXIT_CODE}" ]; then |
66 if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi | 69 if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi |
67 exit 1 | 70 exit 1 |
68 fi | 71 fi |
69 exit 0 | 72 exit 0 |
OLD | NEW |