In order to support fastlane's xcversion behavior of selecting a specific Xcode version just during the lifecycle of the current fastlane lane, we could use some tooling that enabled xcodes to print the Xcode path for a given version.
The related code in fastlane can be found here: https://github.com/fastlane/fastlane/blob/272063487b02b52510bb83172827fcbc336f4a55/fastlane/lib/fastlane/actions/xcversion.rb#L9 - as you can see, xcode-install (aka xcversion) has a function that returns an instance of "xcode" and sets its path as being the current DEVELOPER_DIR to be used by fastlane. If we had something similar in xcodes, then users wouldn't have to enter the sudo password at all when temporarily selecting the Xcode version just for the current build.
We could, alternatively, parse the response printed by xcodes installed as a raw string, regex it using something like:
xcode_paths_regex = /\s([\w\/\-\.\s]+)$/
But that wouldn't be reliable/scalable. I'd be concerned that any type of change in the way we log this could potentially break the regex and thus these 3rd party integrations (namely: fastlane).
Hey 👋
In order to support fastlane's
xcversion
behavior of selecting a specific Xcode version just during the lifecycle of the current fastlane lane, we could use some tooling that enabledxcodes
to print the Xcode path for a given version.The related code in fastlane can be found here: https://github.com/fastlane/fastlane/blob/272063487b02b52510bb83172827fcbc336f4a55/fastlane/lib/fastlane/actions/xcversion.rb#L9 - as you can see,
xcode-install
(akaxcversion
) has a function that returns an instance of "xcode" and sets its path as being the current DEVELOPER_DIR to be used by fastlane. If we had something similar inxcodes
, then users wouldn't have to enter the sudo password at all when temporarily selecting the Xcode version just for the current build.We could, alternatively, parse the response printed by
xcodes installed
as a raw string, regex it using something like:But that wouldn't be reliable/scalable. I'd be concerned that any type of change in the way we log this could potentially break the regex and thus these 3rd party integrations (namely: fastlane).
I'll open a PR with a proposal 🙏