Skip to content

Commit 223da80

Browse files
committed
fix xcode platform detection
1 parent 360e439 commit 223da80

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/electron-release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,20 @@ jobs:
283283
while IFS= read -r XCODE_APP; do
284284
[[ -n "$XCODE_APP" ]] || continue
285285
DEV_DIR="$XCODE_APP/Contents/Developer"
286+
SDK_DIR="$DEV_DIR/Platforms/iPhoneOS.platform/Developer/SDKs"
286287
XCODE_VERSION="$(DEVELOPER_DIR="$DEV_DIR" xcodebuild -version 2>/dev/null | awk 'NR==1 {print $2}')"
287288
SDK_VERSION="$(DEVELOPER_DIR="$DEV_DIR" xcrun --sdk iphoneos --show-sdk-version 2>/dev/null || true)"
288-
echo "Candidate: $XCODE_APP, Xcode ${XCODE_VERSION:-unknown}, iPhoneOS SDK ${SDK_VERSION:-missing}"
289-
if [[ "$XCODE_VERSION" == 26.* && "$SDK_VERSION" == 26.* ]]; then
289+
HAS_PLATFORM="no"
290+
if [[ -d "$SDK_DIR" ]] && find "$SDK_DIR" -maxdepth 1 -name 'iPhoneOS*.sdk' | grep -q .; then
291+
HAS_PLATFORM="yes"
292+
fi
293+
echo "Candidate: $XCODE_APP, Xcode ${XCODE_VERSION:-unknown}, iPhoneOS SDK ${SDK_VERSION:-missing}, platform installed: $HAS_PLATFORM"
294+
if [[ "$XCODE_VERSION" == 26.* && "$SDK_VERSION" == 26.* && "$HAS_PLATFORM" == "yes" ]]; then
290295
SELECTED_XCODE_APP="$XCODE_APP"
291296
break
292297
fi
293298
done <<< "$CANDIDATES"
294-
[[ -n "$SELECTED_XCODE_APP" ]] || { echo "No Xcode 26 installation with iPhoneOS 26 SDK found under /Applications"; exit 1; }
299+
[[ -n "$SELECTED_XCODE_APP" ]] || { echo "No Xcode 26 installation with iPhoneOS 26 SDK platform found under /Applications"; exit 1; }
295300
sudo xcode-select -s "$SELECTED_XCODE_APP/Contents/Developer"
296301
XCODE_VERSION="$(xcodebuild -version | awk 'NR==1 {print $2}')"
297302
SDK_VERSION="$(xcrun --sdk iphoneos --show-sdk-version)"
@@ -465,15 +470,20 @@ jobs:
465470
while IFS= read -r XCODE_APP; do
466471
[[ -n "$XCODE_APP" ]] || continue
467472
DEV_DIR="$XCODE_APP/Contents/Developer"
473+
SDK_DIR="$DEV_DIR/Platforms/iPhoneOS.platform/Developer/SDKs"
468474
XCODE_VERSION="$(DEVELOPER_DIR="$DEV_DIR" xcodebuild -version 2>/dev/null | awk 'NR==1 {print $2}')"
469475
SDK_VERSION="$(DEVELOPER_DIR="$DEV_DIR" xcrun --sdk iphoneos --show-sdk-version 2>/dev/null || true)"
470-
echo "Candidate: $XCODE_APP, Xcode ${XCODE_VERSION:-unknown}, iPhoneOS SDK ${SDK_VERSION:-missing}"
471-
if [[ "$XCODE_VERSION" == 26.* && "$SDK_VERSION" == 26.* ]]; then
476+
HAS_PLATFORM="no"
477+
if [[ -d "$SDK_DIR" ]] && find "$SDK_DIR" -maxdepth 1 -name 'iPhoneOS*.sdk' | grep -q .; then
478+
HAS_PLATFORM="yes"
479+
fi
480+
echo "Candidate: $XCODE_APP, Xcode ${XCODE_VERSION:-unknown}, iPhoneOS SDK ${SDK_VERSION:-missing}, platform installed: $HAS_PLATFORM"
481+
if [[ "$XCODE_VERSION" == 26.* && "$SDK_VERSION" == 26.* && "$HAS_PLATFORM" == "yes" ]]; then
472482
SELECTED_XCODE_APP="$XCODE_APP"
473483
break
474484
fi
475485
done <<< "$CANDIDATES"
476-
[[ -n "$SELECTED_XCODE_APP" ]] || { echo "No Xcode 26 installation with iPhoneOS 26 SDK found under /Applications"; exit 1; }
486+
[[ -n "$SELECTED_XCODE_APP" ]] || { echo "No Xcode 26 installation with iPhoneOS 26 SDK platform found under /Applications"; exit 1; }
477487
sudo xcode-select -s "$SELECTED_XCODE_APP/Contents/Developer"
478488
XCODE_VERSION="$(xcodebuild -version | awk 'NR==1 {print $2}')"
479489
SDK_VERSION="$(xcrun --sdk iphoneos --show-sdk-version)"

mobile/ios/App/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ SPEC CHECKSUMS:
1717
Capacitor: 6e644e9e3369368ac601c77a0fad57f34b78aaa6
1818
CapacitorCordova: f163aa2e84b79efc54d6a75b305bc7e05fb80c5d
1919

20-
PODFILE CHECKSUM: 939e657a824c738a877693596e9e97d488cf2c30
20+
PODFILE CHECKSUM: 440ed8c7c4f01918720918b2d6d0ac1766256efa
2121

2222
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)