Skip to content

doctor: Print xcode-select hint if active dev dir is CommandLineTools#180

Open
dfabulich wants to merge 1 commit intoskiptools:mainfrom
dfabulich:doctor-xcode-select
Open

doctor: Print xcode-select hint if active dev dir is CommandLineTools#180
dfabulich wants to merge 1 commit intoskiptools:mainfrom
dfabulich:doctor-xcode-select

Conversation

@dfabulich
Copy link
Contributor

Fixes skiptools/skip#609

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device


/// Check Xcode version with special handling for CommandLineTools error (https://github.com/skiptools/skip/issues/609).
func checkXcodeVersion(with out: MessageQueue) async throws {
let xcodeDeveloperPath = "/Applications/Xcode.app/Contents/Developer"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check the DEVELOPER_DIR environment variable here in case someone wants to use a beta (or other custom) version of Xcode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's meaningful in this case. xcodeDeveloperPath is only used here to suggest a command for the user to run, if xcodebuild -version fails because they've xcode-selected CommandLineTools.

If they've xcode-selected the release build of Xcode, but they intended to use an Xcode beta, they probably didn't have the presence of mind to set DEVELOPER_DIR. And since xcodebuild -version will succeed in that case, skip doctor is just going to print "[✓] Xcode version 26.2 (> 15.0.0)", so we wouldn't print any error message at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip doctor should suggest using xcode-select if the command-line tools are selected

2 participants

Comments