From bcb3eb628b4170638db361f91b9056e1bbb72bc0 Mon Sep 17 00:00:00 2001 From: Googler Date: Sat, 23 Jul 2016 16:07:08 +0000 Subject: Description redacted. -- MOS_MIGRATED_REVID=128258430 --- tools/objc/ios_runner.sh.mac_template | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tools/objc') diff --git a/tools/objc/ios_runner.sh.mac_template b/tools/objc/ios_runner.sh.mac_template index d7141dc9f1..785d693434 100644 --- a/tools/objc/ios_runner.sh.mac_template +++ b/tools/objc/ios_runner.sh.mac_template @@ -74,7 +74,7 @@ function exit_when_app_not_running() { # $1: the simulator ID to boot function wait_for_sim_to_boot() { i=0 - while [ "${i}" -lt 10 ]; do + while [ "${i}" -lt 60 ]; do # The expected output of "xcrun simctl list" is like: # -- iOS 8.4 -- # iPhone 5s (E946FA1C-26AB-465C-A7AC-24750D520BEA) (Shutdown) @@ -88,7 +88,8 @@ function wait_for_sim_to_boot() { sleep 1 i=$(($i+1)) done - echo "Failed to launch the simulator" + echo "Failed to launch the simulator. The existing simulators are:" + xcrun simctl list exit 1 } @@ -178,6 +179,20 @@ echo "Start the app ${BUNDLE_ID} on ${TEST_DEVICE_ID}." tail -f "${RUN_LOG}" & exit_when_app_not_running "${IOS_PID}" "$!" +# Wait for a while for the system.log to be updated. +sleep 5 + +if [ ! -f "${SYSTEM_LOG}" ];then + output=$(cat "${RUN_LOG}") + # If there's no system.log or output, might be a crash. + if [ -z "${output}" ];then + echo "no output or system.log" + exit 1 + else + exit 0 + fi +fi + # Check the system.log to see if there was an abnormal exit. readonly ABNORMAL_EXIT_MSG=$(cat "${SYSTEM_LOG}" | \ grep "com.apple.CoreSimulator.SimDevice.${TEST_DEVICE_ID}.launchd_sim" | \ -- cgit v1.2.3