aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-22 10:43:34 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-22 10:43:34 -0800
commit2d63859f6f3ec237ce28e550e2db554dd492c1e5 (patch)
tree4d35b393aa25bd9dd9f2fa97238418e5b0a83b9e /platform_tools
parent8f25c667ea975c92d87ad6cb96963946f9845542 (diff)
android_run_skia: dump logcat on failure
logcat -c clears the log before we run. logcat -d dumps the log stdout and exits. BUG=skia: Review URL: https://codereview.chromium.org/870643002
Diffstat (limited to 'platform_tools')
-rwxr-xr-xplatform_tools/android/bin/android_run_skia4
-rwxr-xr-xplatform_tools/android/bin/android_setup.sh2
2 files changed, 6 insertions, 0 deletions
diff --git a/platform_tools/android/bin/android_run_skia b/platform_tools/android/bin/android_run_skia
index 81c4fee013..7c69309aa0 100755
--- a/platform_tools/android/bin/android_run_skia
+++ b/platform_tools/android/bin/android_run_skia
@@ -23,11 +23,13 @@ if [[ -n $RESOURCE_PATH ]]; then
adb_push_if_needed "${SKIA_SRC_DIR}/resources" $RESOURCE_PATH
fi
+if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -c; fi
STATUS_FILENAME="/data/local/tmp/.skia_tmp_$(date +%s%N)"
$ADB ${DEVICE_SERIAL} shell \
"LD_LIBRARY_PATH=/data/local/tmp:$LD_LIBRARY_PATH \
/data/local/tmp/skia_launcher ${APP_ARGS[*]}; echo \$? > ${STATUS_FILENAME}"
if [ -z "$($ADB $DEVICE_SERIAL shell 'if [ -f $STATUS_FILENAME ]; then echo exists; fi')" ]; then
+ if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi
echo "***********************************************************************"
echo "The application terminated unexpectedly and did not produce an exit code"
echo "***********************************************************************"
@@ -39,6 +41,7 @@ $ADB ${DEVICE_SERIAL} shell rm -f ${STATUS_FILENAME}
# check to see if the 'cat' command failed and print errors accordingly
if [[ ${EXIT_CODE} == *${STATUS_FILENAME}* ]]; then
+ if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi
echo "***********************************************************************"
echo "ADB failed to retrieve the application's exit code"
echo "***********************************************************************"
@@ -47,6 +50,7 @@ fi
echo "EXIT_CODE is ${EXIT_CODE}"
if [ $'0\r' != "${EXIT_CODE}" ]; then
+ if [ $LOGCAT ]; then $ADB $DEVICE_SERIAL logcat -d; fi
exit 1
fi
exit 0
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index e97b045da2..eaa6ac531a 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -25,6 +25,8 @@ while (( "$#" )); do
BUILDTYPE=Release
elif [[ "$1" == "--clang" ]]; then
USE_CLANG="true"
+ elif [[ "$1" == "--logcat" ]]; then
+ LOGCAT=1
else
APP_ARGS=("${APP_ARGS[@]}" "${1}")
fi