ci: Set simulator boot wait for snapshot status bar override#120
Merged
ci: Set simulator boot wait for snapshot status bar override#120
Conversation
CI screenshots were showing the real wall-clock time (e.g. 8:41, 8:43)
instead of the overridden 9:41. Snapshot prints on every run:
Waiting 0 seconds for device to fully boot before overriding status bar...
Set 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environment variable to
adjust timeout
With a 0s wait, `xcrun simctl status_bar override` runs against a
not-yet-booted simulator, silently no-ops, and the real clock leaks
into the screenshots.
Root cause is a bug in fastlane/snapshot itself (still unfixed in
2.233.0), in simulator_launcher_base.rb:129:
boot_sleep = ENV["SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT"].to_i || 10
In Ruby `nil.to_i == 0` and `0 || 10` is `0` (0 is truthy). So the
documented 10-second default is 0 unless the env var is set
explicitly.
Set SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT=30 on the CI job steps
that run screenshot lanes. Scoped to CI because hosted runners are
slow; local Macs usually boot the simulator fast enough that the 0s
wait isn't a problem.
📲 Install BuildsiOS
|
release-beta.yml also runs generate_and_upload_screenshots_ci and was missed in the previous commit. Without this env var, the weekly Monday 04:00 UTC beta uploads Sentry screenshots with the real wall- clock time instead of the overridden 9:41.
philprime
added a commit
that referenced
this pull request
Apr 22, 2026
_boot_simulator ran `xcrun simctl boot` and immediately returned, but that command only kicks off the boot process — it doesn't wait for the simulator to reach the home screen. On slow CI runners, _override_status_bar would then race the boot and silently no-op, leaking the real clock into screenshots (same class of bug that PR #120 fixed in the snapshot action's path). Add `xcrun simctl bootstatus <udid> -b` after `boot` to block until the simulator is fully booted. This matches what fastlane/snapshot does in simulator_launcher_base.rb:124.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI screenshots were shipping with the real wall-clock time (e.g. 8:41, 8:43) instead of the expected 9:41. Snapshot prints on every run:
With a 0s wait,
xcrun simctl status_bar overrideruns against a not-yet-booted simulator, silently no-ops, and the real clock leaks into the screenshots.Root cause is a bug in fastlane/snapshot itself (still unfixed in 2.233.0), in
simulator_launcher_base.rb:129:In Ruby
nil.to_i == 0, and0 || 10evaluates to0because0is truthy. The documented 10-second default is actually 0 unless the env var is set.Fix: set
SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT=30on the CI job steps that invoke snapshot lanes (build-test.ymlScreenshots job,release.ymlRelease step). Scoped to CI because hosted runners are slow; local Macs boot the simulator fast enough that the 0s wait rarely bites.Worth reporting the Ruby truthiness bug upstream — one-liner fix like
(ENV[...] || "10").to_i— but for now this is the right workaround.