@@ -137,7 +137,9 @@ xcrun simctl spawn $DEVICE_ID defaults write $BUNDLE_ID $USER_DEFAULT_KEY -bool
137137log " Launching app with expected crash."
138138xcrun simctl launch $DEVICE_ID $BUNDLE_ID
139139
140- # Check every 100ms for 5 seconds if the app is still running.
140+ log " Starting to check if app crashed as expected."
141+
142+ # Check for 20 seconds if the app is still running.
141143start_time=$( date +%s)
142144while true ; do
143145 if is_app_running; then
@@ -150,10 +152,11 @@ while true; do
150152 current_time=$( date +%s)
151153 elapsed=$(( current_time - start_time))
152154
153- if [ $elapsed -ge 5 ]; then
154- log " ❌ App is still running after 5 seconds but it should have crashed instead."
155+ if [ $elapsed -ge 20 ]; then
156+ log " ❌ App is still running after 20 seconds but it should have crashed instead."
155157 exit 1
156158 fi
159+
157160done
158161
159162take_simulator_screenshot " after-crash"
@@ -171,7 +174,9 @@ xcrun simctl launch $DEVICE_ID $BUNDLE_ID &
171174
172175take_simulator_screenshot " after-crash-check"
173176
174- # Check for 5 seconds if the app is running.
177+ log " Starting to check if app is running."
178+
179+ # Check for 20 seconds if the app is still running.
175180start_time=$( date +%s)
176181while true ; do
177182 if is_app_running; then
@@ -183,7 +188,7 @@ while true; do
183188 current_time=$( date +%s)
184189 elapsed=$(( current_time - start_time))
185190
186- if [ $elapsed -ge 5 ]; then
191+ if [ $elapsed -ge 20 ]; then
187192 log " ✅ Completed checking if app is still running."
188193 break
189194 fi
0 commit comments