-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[scan] Filter simulators with version greater than SDK version of active Xcode installation when choosing default #21677
Conversation
aacdbca
to
b93e3d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. A couple of comments.
Related to that feature, I see that we have lots of weird errors when setting up our simulators environments in CI and wonder if we could use some similar logic to avoid them (and speed up the setup) and thus the builds.

I believe this happens here
@lacostej addressed the later two comments.
As far as I can tell, the logic would be different and would require more substantial changes to that file. For the error attached, what seems to be going on is |
962248b
to
d12b8bc
Compare
d12b8bc
to
129f467
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks good now, except maybe the place in the code where @runtime_build_os_version
is populated depending on the caller calling things in order.
f598a36
to
0d8dcdf
Compare
This change seems to have added the following message in output on some platforms.
Probably caused by |
…ive Xcode installation when choosing default (fastlane#21677) * [scan] Filter simulators with version greater than currently installed SDK * addressing feedback * redo implementation using suggested CLI invocations * better description for test case * addressing feedback * move runtime_build_os_versions into own function * fix odd indentation
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
Xcode 15 introduced a new Simulator subsystem in macOS that is shared across all Xcode versions installed on a machine. Previously, each Xcode had its own separate system service and set of devices for which it could run. With Xcode 15 installed, each Xcode now has access to many of the devices and runtimes for each Xcode version installed on a machine.
This is an issue for fastlane, as it currently picks the latest simulator version for a given device, unless the user explicitly specifies otherwise.
For example, suppose an environment has installations of both Xcode14 and Xcode15, with Xcode14 set as active. For the device
'iPhone 14'
, scan will select iOS simulator 17.0 instead of 16.4. One must use'iPhone 14 (16.4)'
to run on the default Xcode14 simulator.Under the proposed changes,
'iPhone 14'
would result in selection of the expected 16.4 simulator. If users wish to run on an older or newer simulator version, the behavior is as before i.e.'iPhone14 (16.1)'
for the older 16.1 simulator or'iPhone 14 (17.0)'
for the newer 17.0 simulator.Description
The changes affect
Scan::DetectValues
. A function nameddetect_sdk_version
is added to determine default simulator SDK versions of the active Xcode installation. We use this information as an upper bound when filtering the set of available simulators if users do not specify a version. The new filtering heuristic is contained withincompatible_with_sdk
.Testing Steps
Updated unit tests to exercise new functionality. Tested in local envrionment and CI.