@@ -3,9 +3,43 @@ set -eu -o pipefail
33
44# # Builds an ipa file for iOS. Should be run from the repo-root
55
6- # Create Xcode file and build
7- qmake -spec macx-xcode Jamulus.pro
8- /usr/bin/xcodebuild -project Jamulus.xcodeproj -scheme Jamulus -configuration Release clean archive -archivePath " build/Jamulus.xcarchive" CODE_SIGN_IDENTITY=" " CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_ENTITLEMENTS=" "
6+ # Find the latest iOS SDK available in Xcode
7+ AVAILABLE_SDK=$( xcrun --sdk iphoneos --show-sdk-version 2> /dev/null || echo " " )
8+ if [ -z " $AVAILABLE_SDK " ]; then
9+ echo " Error: No iOS SDK found in Xcode"
10+ exit 1
11+ fi
12+ echo " Using iOS SDK: $AVAILABLE_SDK "
13+
14+ # Create Xcode file and build with explicit iOS deployment target and SDK version
15+ qmake -spec macx-xcode QMAKE_IPHONEOS_DEPLOYMENT_TARGET=15.0 QMAKE_IOS_DEPLOYMENT_VERSION=15.0 Jamulus.pro
16+
17+ # Fix the Xcode project to remove references to iOS versions not available in the current Xcode
18+ # Replace iOS 18.2+ with 18.1 (the latest available in Xcode 16.2.0)
19+ # This is a temporary workaround and should be removed once Qt is built with compatible SDK versions
20+ if [ -f " Jamulus.xcodeproj/project.pbxproj" ]; then
21+ # Check for iOS 18.2+ references in various formats
22+ if grep -q -E ' IPHONEOS_DEPLOYMENT_TARGET\s*=\s*18\.[2-9]|18\.[2-9];|iphoneos18\.[2-9]' Jamulus.xcodeproj/project.pbxproj; then
23+ echo " Found iOS 18.2+ references in Xcode project, applying sed fixes..."
24+ sed -i ' ' -E ' s/IPHONEOS_DEPLOYMENT_TARGET\s*=\s*18\.[2-9]/IPHONEOS_DEPLOYMENT_TARGET = 18.1/g' Jamulus.xcodeproj/project.pbxproj
25+ sed -i ' ' -E ' s/SDKROOT\s*=\s*iphoneos18\.[2-9]/SDKROOT = iphoneos18.1/g' Jamulus.xcodeproj/project.pbxproj
26+ sed -i ' ' ' s/18\.[2-9];/18.1;/g' Jamulus.xcodeproj/project.pbxproj
27+ else
28+ # Also check the generated LaunchScreen.storyboard
29+ if find Jamulus.xcodeproj -name " *.storyboard" -exec grep -l ' 18\.[2-9]' {} \; 2> /dev/null; then
30+ echo " Found iOS 18.2+ references in storyboard files, applying fixes..."
31+ find Jamulus.xcodeproj -name " *.storyboard" -exec sed -i ' ' ' s/18\.[2-9]/18.1/g' {} \;
32+ else
33+ echo " WARNING: No iOS 18.2+ references found in Xcode project files."
34+ echo " The sed workaround in deploy_ios.sh may no longer be needed and should be reviewed for removal."
35+ fi
36+ fi
37+ fi
38+ # Build with explicit iOS deployment target and device SDK to avoid simulator and SDK mismatch errors
39+ /usr/bin/xcodebuild -project Jamulus.xcodeproj -scheme Jamulus -configuration Release -sdk iphoneos clean archive -archivePath " build/Jamulus.xcarchive" \
40+ IPHONEOS_DEPLOYMENT_TARGET=15.0 \
41+ SDKROOT=iphoneos \
42+ CODE_SIGN_IDENTITY=" " CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_ENTITLEMENTS=" "
943
1044# Generate ipa by copying the .app file from the xcarchive directory
1145mkdir build/Payload
0 commit comments