Launching the iOS simulator on Xcode 11.4 stack taking longer

Bitrise Build Issue Report template

Description of the issue

On the Xcode 11.3 stack, launching the simulator to run tests would take about 2 min. No on the Xcode 11.4 stack, launching the simulator is taking 3+ min.

Environment:

Where did the issue happen?
Xcode 11.4 stack

Which build Step causes the issue and which version of the step?
A script step that is running fastlane run_tests

Reproducibility

  • Does a ā€œRebuildā€ help? (You can trigger a rebuild from the Buildā€™s page, by clicking the ā€œRebuildā€ button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : When we first tried out the Xcode 11.4 stack

Local reproduction

No, build times are much faster locally so itā€™s very difficult to compare.

Build log

Hi @CraigSiemens,
are you also facing the issue that the iOS watchdog kills the app due to this with the 0x8badf00d error code? On the Xcode 11.4 stack we often see this happening while running the unit tests.

Hi @florian.fittschen,

We are facing those issues as well, with the following output:
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d

Did you find a workaround for this?

Sadly noā€¦ Since Iā€™m also not sure if this is an issue with the image of the Xcode 11.4 stack or if it is an issue on Apples side I also filed a Feedback (FB7656887).

We prevent from 0x8badf00d issue, add the below workaround before scan in Fastfile.

unless system("xcrun simctl list | grep -E \"#{devices.first} \\(.*\\) \\(Booted\\) \\$\"")
      sh "xcrun simctl boot \"#{devices.first}\""
end
sh "xcrun simctl spawn \"#{devices.first}\" defaults write com.apple.springboard FBLaunchWatchdogScale 2"

We found the workaround in Xcode 11 release notes.
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes

After adding it, the job works well.

We also tried this workaround, but it only reduced the 0x8badf00d error from roughly 9 out of 10 cases to around 5 out of 10 cases. So it is still occurring in the majority of our builds.

We havenā€™t run into any issues with watchdog killing the app when running our unit tests. Itā€™s just taking a long time for the simulator to start up.

Iā€™m actually using Bitriseā€™s xcode-test step not fastlane, so I do not have a way to handle simulator boot (afaik)

So it seems it got fixed in Xcode 11.4.1 :clap:

Fixed an issue where large binaries could cause watchdog timeouts or failures to launch in the simulator. (61013375)

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.