Skip to content

Commit

Permalink
fix: handle outdated system Xcode version (#655)
Browse files Browse the repository at this point in the history
* fix: handle outdated system Xcode version

* Update src/utils/sdk.js

Co-authored-by: David Sanders <[email protected]>

---------

Co-authored-by: David Sanders <[email protected]>
  • Loading branch information
codebytere and dsanders11 authored Oct 14, 2024
1 parent dae60ab commit ab360b6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/utils/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,24 @@ function expectedSDKVersion() {
return version;
}

// Ensure that the user has a version of Xcode installed and usable.
function ensureViableXCode() {
const xcodeBuildExec = '/usr/bin/xcodebuild';
if (fs.existsSync(xcodeBuildExec)) {
const result = cp.spawnSync(xcodeBuildExec, ['-version']);
if (result.status === 0) return;
if (result.status === 0) {
const match = result.stdout
.toString()
.trim()
.match(/Xcode (\d+\.\d+)/);
if (match) {
if (!semver.satisfies(semver.coerce(match[1]), '>14')) {
fatal(`Xcode version ${match[1]} is not supported, please upgrade to Xcode 15 or newer`);
} else {
return;
}
}
}
}

fatal(`Xcode appears to be missing, you may have Command Line Tools installed but not a full Xcode. Please install Xcode now...
Expand Down

0 comments on commit ab360b6

Please sign in to comment.