Skip to content

Commit 339948d

Browse files
abueideclaude
andcommitted
fix(ios): prefer xcode-select over version scan for Xcode resolution
Reorder ios_resolve_developer_dir() priority so xcode-select -p is checked before scanning /Applications for the highest-version Xcode. On CI runners with multiple Xcode versions (including betas), the version scan picked Xcode 26.4 beta which lacks iOS 26.2 runtime, breaking RN iOS builds. Respecting xcode-select honors the explicit pinning set by sudo xcode-select -s in CI workflows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a468454 commit 339948d

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

  • plugins/ios/virtenv/scripts/platform

plugins/ios/virtenv/scripts/platform/core.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,15 @@ ios_latest_xcode_dev_dir() {
7070
}
7171

7272
# Resolve developer directory with multiple fallback strategies
73+
# Priority: IOS_DEVELOPER_DIR env > xcode-select > latest Xcode scan > fallback
7374
ios_resolve_developer_dir() {
7475
desired="${IOS_DEVELOPER_DIR:-}"
7576
if [ -n "$desired" ] && [ -d "$desired" ]; then
7677
printf '%s\n' "$desired"
7778
return 0
7879
fi
7980

80-
desired="$(ios_latest_xcode_dev_dir 2>/dev/null || true)"
81-
if [ -n "$desired" ] && [ -d "$desired" ]; then
82-
printf '%s\n' "$desired"
83-
return 0
84-
fi
85-
81+
# Prefer xcode-select (respects system/CI Xcode pinning via sudo xcode-select -s)
8682
if command -v xcode-select >/dev/null 2>&1; then
8783
desired="$(xcode-select -p 2>/dev/null || true)"
8884
if [ -n "$desired" ] && [ -d "$desired" ]; then
@@ -91,6 +87,13 @@ ios_resolve_developer_dir() {
9187
fi
9288
fi
9389

90+
# Fallback: scan /Applications for highest-version Xcode
91+
desired="$(ios_latest_xcode_dev_dir 2>/dev/null || true)"
92+
if [ -n "$desired" ] && [ -d "$desired" ]; then
93+
printf '%s\n' "$desired"
94+
return 0
95+
fi
96+
9497
if [ -d /Applications/Xcode.app/Contents/Developer ]; then
9598
printf '%s\n' "/Applications/Xcode.app/Contents/Developer"
9699
return 0

0 commit comments

Comments
 (0)