Skip to content

feat(iOS): check for SDK#360

Merged
jeromelaban merged 1 commit intomainfrom
dev/anpi/fix.check.iossdk
Apr 10, 2025
Merged

feat(iOS): check for SDK#360
jeromelaban merged 1 commit intomainfrom
dev/anpi/fix.check.iossdk

Conversation

@ajpinedam
Copy link
Copy Markdown
Contributor

@ajpinedam ajpinedam commented Apr 2, 2025

fixes #172

This pull request introduces a new validation step to ensure the iOS SDK is installed when examining the Xcode setup.

Validation Enhancement:

  • Added a check in public override Task<DiagnosticResult> Examine(SharedState history) to validate the presence of the iOS SDK and provide instructions if it is missing.
  • Introduced a new method ValidateForiOSSDK(XCodeInfo selected) to encapsulate the logic for checking the iOS SDK installation.

@ajpinedam ajpinedam requested a review from jeromelaban April 2, 2025 21:41
@ajpinedam ajpinedam self-assigned this Apr 2, 2025
@ajpinedam ajpinedam force-pushed the dev/anpi/fix.check.iossdk branch from 9047369 to cfe6e25 Compare April 2, 2025 21:42
@jeromelaban jeromelaban merged commit 404bc73 into main Apr 10, 2025
43 checks passed
@jeromelaban jeromelaban deleted the dev/anpi/fix.check.iossdk branch April 10, 2025 19:11

if (Directory.Exists(iphoneSimulatorSDKPath))
{
return true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you delete the iOS SDK (from Xcode Component's window) then the directory will still be present, so the check will pass but the SDK will be missing (at build time).

return Task.FromResult(new DiagnosticResult(
Status.Error,
this,
new Suggestion("Run `open -a Xcode`",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That suggestion will not work if copy/pasted into a terminal. IOW it won't start Xcode (no path) and, if fixed, it won't show the Component window where the SDK can be loaded.

We should implement the steps from https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line

so we download and install the SDK from uno-check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check if iOS SDK is installed for the select Xcode

3 participants