From 65256eaf00e4c7b704fa410eaac9536c0cdf308f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 02:14:49 +0000 Subject: [PATCH 01/10] chore(deps): update all dependencies --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08107f1..ca0da93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] node: [20] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} @@ -30,10 +30,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 - name: Setup environment uses: ./ with: @@ -52,7 +52,7 @@ jobs: ionic cordova platform add android@latest ionic cordova build android - name: Upload Android APK (Cordova) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: android-apk-cordova-${{ matrix.os }} path: | @@ -75,10 +75,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 - name: Setup environment uses: ./ with: @@ -105,7 +105,7 @@ jobs: shell: pwsh run: pwsh -File scripts/inject-gradle-java17.ps1 -AppPath testapp - name: Upload Android APK (Capacitor) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: android-apk-${{ runner.os }} path: | From 986658bfb1dc4fbdf25170ea1f3eea1f8d4d71b5 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 5 Dec 2025 01:28:22 +0900 Subject: [PATCH 02/10] Add scripts/patch-ios.sh to patch generated iOS files in CI --- scripts/patch-ios.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 scripts/patch-ios.sh diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh new file mode 100644 index 0000000..a240f47 --- /dev/null +++ b/scripts/patch-ios.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Paths +PBX_PATH="platforms/ios/App.xcodeproj/project.pbxproj" +APPDELEGATE_PATH="platforms/ios/App/AppDelegate.swift" +XC_CONFIG_DIR="platforms/ios/xcconfigs" +XC_CONFIG_PATH="${XC_CONFIG_DIR}/ci-overrides.xcconfig" +PODFILE_PATH="platforms/ios/Podfile" + +# Helper for portable sed - macOS needs -i '' +if [[ "$(uname -s)" == "Darwin" ]]; then + SED_CMD=(sed -i "") + SED_EXT_ARG=(-E) +else + SED_CMD=(sed -i) + SED_EXT_ARG=(-r) +fi + +echo "Patching iOS generated files..." + +# 1) Bump IPHONEOS_DEPLOYMENT_TARGET to 13.0 (only if file exists) +if [[ -f "$PBX_PATH" ]]; then + echo " - Updating deployment target in ${PBX_PATH}" + # Use a regex that matches X.Y with 1-2 digits + "${SED_CMD[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true +else + echo " - ${PBX_PATH} not found, skipping deployment target patch" +fi + +# 2) Add @available(iOS 13.0, *) before extension AppDelegate { if not already present +if [[ -f "$APPDELEGATE_PATH" ]]; then + if ! grep -q "@available(iOS 13.0" "$APPDELEGATE_PATH"; then + echo " - Adding @available(iOS 13.0, *) to ${APPDELEGATE_PATH}" + # Insert the attribute on the line before 'extension AppDelegate {' + awk ' + BEGIN { added=0 } + { + if (!added && $0 ~ /^extension[[:space:]]+AppDelegate[[:space:]]*\{/ ) { + print "@available(iOS 13.0, *)" + added=1 + } + print $0 + } + ' "$APPDELEGATE_PATH" > "${APPDELEGATE_PATH}.patched" && mv "${APPDELEGATE_PATH}.patched" "$APPDELEGATE_PATH" + else + echo " - @available already present in ${APPDELEGATE_PATH}" + fi +else + echo " - ${APPDELEGATE_PATH} not found, skipping AppDelegate patch" +fi + +# 3) Ensure Podfile platform is at least 13.0 +if [[ -f "$PODFILE_PATH" ]]; then + echo " - Ensuring Podfile platform is at least iOS 13.0" + # Replace lines like: platform :ios, '11.0' or platform :ios, "11.0" + awk ' + BEGIN{OFS=FS} + { + if ($0 ~ /^\s*platform\s*:\s*ios\s*,/) { + sub(/[:space:]*platform[[:space:]]*:[[:space:]]*ios[[:space:]]*,[[:space:]]*['"]?[0-9]+\.[0-9]+['"]?/, "platform :ios, '13.0'") + } + print + } + ' "$PODFILE_PATH" > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" || true +else + echo " - ${PODFILE_PATH} not found, skipping Podfile patch" +fi + +# 4) Create an xcconfig to add GeneratedModuleMaps-iphonesimulator to header search paths +mkdir -p "$XC_CONFIG_DIR" +cat > "$XC_CONFIG_PATH" <<'XC' +HEADER_SEARCH_PATHS = $(inherited) $(DERIVED_FILE_DIR)/GeneratedModuleMaps-iphonesimulator +XC + +echo " - Created ${XC_CONFIG_PATH}" + +echo "Patching complete." \ No newline at end of file From 1b01120e1ad49c146ecf7d0ed7bfb500eefbd20d Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 5 Dec 2025 02:22:01 +0900 Subject: [PATCH 03/10] Fix iOS patch script for target flexibility --- scripts/patch-ios.sh | 118 +++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh index a240f47..95ddf63 100644 --- a/scripts/patch-ios.sh +++ b/scripts/patch-ios.sh @@ -1,78 +1,84 @@ #!/usr/bin/env bash set -euo pipefail -# Paths -PBX_PATH="platforms/ios/App.xcodeproj/project.pbxproj" -APPDELEGATE_PATH="platforms/ios/App/AppDelegate.swift" -XC_CONFIG_DIR="platforms/ios/xcconfigs" -XC_CONFIG_PATH="${XC_CONFIG_DIR}/ci-overrides.xcconfig" -PODFILE_PATH="platforms/ios/Podfile" +# Usage: scripts/patch-ios.sh [target-dir ...] +# If no targets provided, it will attempt both 'platforms/ios' (Cordova) and 'ios' (Capacitor). + +if [[ $# -gt 0 ]]; then + TARGETS=("$@") +else + TARGETS=("platforms/ios" "ios") +fi # Helper for portable sed - macOS needs -i '' if [[ "$(uname -s)" == "Darwin" ]]; then - SED_CMD=(sed -i "") - SED_EXT_ARG=(-E) + SED_INPLACE=(sed -i '') else - SED_CMD=(sed -i) - SED_EXT_ARG=(-r) + SED_INPLACE=(sed -i) fi -echo "Patching iOS generated files..." +echo "Patching iOS generated files for targets: ${TARGETS[*]}" -# 1) Bump IPHONEOS_DEPLOYMENT_TARGET to 13.0 (only if file exists) -if [[ -f "$PBX_PATH" ]]; then - echo " - Updating deployment target in ${PBX_PATH}" - # Use a regex that matches X.Y with 1-2 digits - "${SED_CMD[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true -else - echo " - ${PBX_PATH} not found, skipping deployment target patch" -fi +for BASE in "${TARGETS[@]}"; do + echo "Processing target: ${BASE}" + PBX_PATH="${BASE}/App.xcodeproj/project.pbxproj" + APPDELEGATE_PATH="${BASE}/App/AppDelegate.swift" + XC_CONFIG_DIR="${BASE}/xcconfigs" + XC_CONFIG_PATH="${XC_CONFIG_DIR}/ci-overrides.xcconfig" + PODFILE_PATH="${BASE}/Podfile" + + # 1) Bump IPHONEOS_DEPLOYMENT_TARGET to 13.0 (only if file exists) + if [[ -f "$PBX_PATH" ]]; then + echo " - Updating deployment target in ${PBX_PATH}" + "${SED_INPLACE[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true + else + echo " - ${PBX_PATH} not found, skipping deployment target patch" + fi + + # 2) Add @available(iOS 13.0, *) before extension AppDelegate { if not already present + if [[ -f "$APPDELEGATE_PATH" ]]; then + if ! grep -q "@available(iOS 13.0" "$APPDELEGATE_PATH"; then + echo " - Adding @available(iOS 13.0, *) to ${APPDELEGATE_PATH}" + awk ' + BEGIN { added=0 } + { + if (!added && $0 ~ /^extension[[:space:]]+AppDelegate[[:space:]]*\{/ ) { + print "@available(iOS 13.0, *)" + added=1 + } + print $0 + } + ' "$APPDELEGATE_PATH" > "${APPDELEGATE_PATH}.patched" && mv "${APPDELEGATE_PATH}.patched" "$APPDELEGATE_PATH" + else + echo " - @available already present in ${APPDELEGATE_PATH}" + fi + else + echo " - ${APPDELEGATE_PATH} not found, skipping AppDelegate patch" + fi -# 2) Add @available(iOS 13.0, *) before extension AppDelegate { if not already present -if [[ -f "$APPDELEGATE_PATH" ]]; then - if ! grep -q "@available(iOS 13.0" "$APPDELEGATE_PATH"; then - echo " - Adding @available(iOS 13.0, *) to ${APPDELEGATE_PATH}" - # Insert the attribute on the line before 'extension AppDelegate {' + # 3) Ensure Podfile platform is at least 13.0 + if [[ -f "$PODFILE_PATH" ]]; then + echo " - Ensuring Podfile platform is at least iOS 13.0" awk ' - BEGIN { added=0 } { - if (!added && $0 ~ /^extension[[:space:]]+AppDelegate[[:space:]]*\{/ ) { - print "@available(iOS 13.0, *)" - added=1 + if ($0 ~ /^\s*platform\s*:\s*.*ios/) { + print "platform :ios, '\''13.0'\''" + } else { + print } - print $0 } - ' "$APPDELEGATE_PATH" > "${APPDELEGATE_PATH}.patched" && mv "${APPDELEGATE_PATH}.patched" "$APPDELEGATE_PATH" + ' "$PODFILE_PATH" > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" || true else - echo " - @available already present in ${APPDELEGATE_PATH}" + echo " - ${PODFILE_PATH} not found, skipping Podfile patch" fi -else - echo " - ${APPDELEGATE_PATH} not found, skipping AppDelegate patch" -fi - -# 3) Ensure Podfile platform is at least 13.0 -if [[ -f "$PODFILE_PATH" ]]; then - echo " - Ensuring Podfile platform is at least iOS 13.0" - # Replace lines like: platform :ios, '11.0' or platform :ios, "11.0" - awk ' - BEGIN{OFS=FS} - { - if ($0 ~ /^\s*platform\s*:\s*ios\s*,/) { - sub(/[:space:]*platform[[:space:]]*:[[:space:]]*ios[[:space:]]*,[[:space:]]*['"]?[0-9]+\.[0-9]+['"]?/, "platform :ios, '13.0'") - } - print - } - ' "$PODFILE_PATH" > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" || true -else - echo " - ${PODFILE_PATH} not found, skipping Podfile patch" -fi -# 4) Create an xcconfig to add GeneratedModuleMaps-iphonesimulator to header search paths -mkdir -p "$XC_CONFIG_DIR" -cat > "$XC_CONFIG_PATH" <<'XC' + # 4) Create an xcconfig to add GeneratedModuleMaps-iphonesimulator to header search paths + mkdir -p "$XC_CONFIG_DIR" + cat > "$XC_CONFIG_PATH" <<'XC' HEADER_SEARCH_PATHS = $(inherited) $(DERIVED_FILE_DIR)/GeneratedModuleMaps-iphonesimulator XC + echo " - Created ${XC_CONFIG_PATH}" -echo " - Created ${XC_CONFIG_PATH}" +done -echo "Patching complete." \ No newline at end of file +echo "Patching complete." From e0474c92086ace9ed4ab55e451ee1fb6e95e33e7 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 5 Dec 2025 02:23:14 +0900 Subject: [PATCH 04/10] Update CI workflow for iOS builds with patch script --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca0da93..d2ac37a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,10 @@ jobs: run: | cd testapp ionic cordova platform add ios@latest - ionic cordova build ios --no-interactive -- --buildFlag="-sdk iphonesimulator" + # run the patch script from the repository root to adjust generated iOS files in CI + bash ../../scripts/patch-ios.sh platforms/ios + # build and instruct Cordova/Xcode to use the xcconfig the script creates + ionic cordova build ios --no-interactive -- --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" --buildFlag="-sdk iphonesimulator" test-capacitor: name: Test (Capacitor) @@ -118,4 +121,6 @@ jobs: cd testapp ionic cap add ios npx cap sync ios - xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build + # run the patch script to adjust generated Capacitor iOS files in CI + bash ../../scripts/patch-ios.sh ios + xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build -xcconfig ios/xcconfigs/ci-overrides.xcconfig From 60f1cd8bf43459273c6daeeea0603d97d4915296 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 5 Dec 2025 02:43:02 +0900 Subject: [PATCH 05/10] Fix script path in CI workflow for iOS builds --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2ac37a..fc356fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: cd testapp ionic cordova platform add ios@latest # run the patch script from the repository root to adjust generated iOS files in CI - bash ../../scripts/patch-ios.sh platforms/ios + bash scripts/patch-ios.sh platforms/ios # build and instruct Cordova/Xcode to use the xcconfig the script creates ionic cordova build ios --no-interactive -- --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" --buildFlag="-sdk iphonesimulator" @@ -122,5 +122,5 @@ jobs: ionic cap add ios npx cap sync ios # run the patch script to adjust generated Capacitor iOS files in CI - bash ../../scripts/patch-ios.sh ios + bash scripts/patch-ios.sh ios xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build -xcconfig ios/xcconfigs/ci-overrides.xcconfig From 469fc004442fb8a354f5dc7317ea7e507c96d111 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 5 Dec 2025 03:02:06 +0900 Subject: [PATCH 06/10] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc356fc..297e351 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: cd testapp ionic cordova platform add ios@latest # run the patch script from the repository root to adjust generated iOS files in CI - bash scripts/patch-ios.sh platforms/ios + bash ../scripts/patch-ios.sh platforms/ios # build and instruct Cordova/Xcode to use the xcconfig the script creates ionic cordova build ios --no-interactive -- --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" --buildFlag="-sdk iphonesimulator" @@ -122,5 +122,5 @@ jobs: ionic cap add ios npx cap sync ios # run the patch script to adjust generated Capacitor iOS files in CI - bash scripts/patch-ios.sh ios + bash ../scripts/patch-ios.sh ios xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build -xcconfig ios/xcconfigs/ci-overrides.xcconfig From 639ebff5885e7dc2427d9112fe39f828fc5fb23e Mon Sep 17 00:00:00 2001 From: coturiv Date: Fri, 5 Dec 2025 03:37:54 +0900 Subject: [PATCH 07/10] ci(cordova-ios): fix Cordova iOS build in CI; update patch-ios.sh and remove Capacitor-specific CI patching --- .github/workflows/ci.yml | 12 ++++++---- scripts/patch-ios.sh | 52 ++++++++++++++++++++++++++++++++-------- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 297e351..73975f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,14 @@ jobs: ionic cordova platform add ios@latest # run the patch script from the repository root to adjust generated iOS files in CI bash ../scripts/patch-ios.sh platforms/ios + # verify CocoaPods and ensure specs are up-to-date (redundant with script but safe) + pod --version || true + (cd platforms/ios && pod install --repo-update) || true # build and instruct Cordova/Xcode to use the xcconfig the script creates - ionic cordova build ios --no-interactive -- --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" --buildFlag="-sdk iphonesimulator" + ionic cordova build ios --no-interactive -- \ + --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" \ + --buildFlag="-sdk iphonesimulator" \ + --buildFlag="-destination generic/platform=iOS Simulator" test-capacitor: name: Test (Capacitor) @@ -121,6 +127,4 @@ jobs: cd testapp ionic cap add ios npx cap sync ios - # run the patch script to adjust generated Capacitor iOS files in CI - bash ../scripts/patch-ios.sh ios - xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build -xcconfig ios/xcconfigs/ci-overrides.xcconfig + xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh index 95ddf63..4c7b475 100644 --- a/scripts/patch-ios.sh +++ b/scripts/patch-ios.sh @@ -2,12 +2,11 @@ set -euo pipefail # Usage: scripts/patch-ios.sh [target-dir ...] -# If no targets provided, it will attempt both 'platforms/ios' (Cordova) and 'ios' (Capacitor). if [[ $# -gt 0 ]]; then TARGETS=("$@") else - TARGETS=("platforms/ios" "ios") + TARGETS=("platforms/ios") fi # Helper for portable sed - macOS needs -i '' @@ -31,6 +30,10 @@ for BASE in "${TARGETS[@]}"; do if [[ -f "$PBX_PATH" ]]; then echo " - Updating deployment target in ${PBX_PATH}" "${SED_INPLACE[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true + + echo " - Ensuring simulator excludes arm64 in ${PBX_PATH}" + # Add EXCLUDED_ARCHS for simulator to avoid arm64 issues on some pods + "${SED_INPLACE[@]}" "/buildSettings = {$/a\\ EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64;" "$PBX_PATH" || true else echo " - ${PBX_PATH} not found, skipping deployment target patch" fi @@ -59,15 +62,42 @@ for BASE in "${TARGETS[@]}"; do # 3) Ensure Podfile platform is at least 13.0 if [[ -f "$PODFILE_PATH" ]]; then echo " - Ensuring Podfile platform is at least iOS 13.0" - awk ' - { - if ($0 ~ /^\s*platform\s*:\s*.*ios/) { - print "platform :ios, '\''13.0'\''" - } else { - print + if grep -q "^\s*platform\s*:\s*.*ios" "$PODFILE_PATH"; then + awk ' + { + if ($0 ~ /^\s*platform\s*:\s*.*ios/) { + print "platform :ios, '\''13.0'\''" + } else { + print + } } - } - ' "$PODFILE_PATH" > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" || true + ' "$PODFILE_PATH" > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" || true + else + # Prepend platform line if missing + { + echo "platform :ios, '13.0'" + cat "$PODFILE_PATH" + } > "${PODFILE_PATH}.patched" && mv "${PODFILE_PATH}.patched" "$PODFILE_PATH" + fi + + # Ensure pods build with at least iOS 13.0 (add post_install if missing) + if ! grep -q "post_install" "$PODFILE_PATH"; then + cat >> "$PODFILE_PATH" <<'PODPATCH' +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + end + end +end +PODPATCH + fi + + echo " - Running CocoaPods install with repo update" + ( + cd "$BASE" + pod install --repo-update --silent || pod install --repo-update || true + ) else echo " - ${PODFILE_PATH} not found, skipping Podfile patch" fi @@ -76,6 +106,8 @@ for BASE in "${TARGETS[@]}"; do mkdir -p "$XC_CONFIG_DIR" cat > "$XC_CONFIG_PATH" <<'XC' HEADER_SEARCH_PATHS = $(inherited) $(DERIVED_FILE_DIR)/GeneratedModuleMaps-iphonesimulator +EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 +ONLY_ACTIVE_ARCH = YES XC echo " - Created ${XC_CONFIG_PATH}" From e9721c687417520e3e0c1bca65f66a331d96b256 Mon Sep 17 00:00:00 2001 From: coturiv Date: Fri, 5 Dec 2025 03:51:55 +0900 Subject: [PATCH 08/10] ci(cordova-ios): fix sed append; conditionally run pod install when Podfile exists --- .github/workflows/ci.yml | 2 +- scripts/patch-ios.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73975f9..169fc70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: bash ../scripts/patch-ios.sh platforms/ios # verify CocoaPods and ensure specs are up-to-date (redundant with script but safe) pod --version || true - (cd platforms/ios && pod install --repo-update) || true + if [ -f platforms/ios/Podfile ]; then (cd platforms/ios && pod install --repo-update); fi # build and instruct Cordova/Xcode to use the xcconfig the script creates ionic cordova build ios --no-interactive -- \ --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" \ diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh index 4c7b475..c99efae 100644 --- a/scripts/patch-ios.sh +++ b/scripts/patch-ios.sh @@ -32,8 +32,18 @@ for BASE in "${TARGETS[@]}"; do "${SED_INPLACE[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true echo " - Ensuring simulator excludes arm64 in ${PBX_PATH}" - # Add EXCLUDED_ARCHS for simulator to avoid arm64 issues on some pods - "${SED_INPLACE[@]}" "/buildSettings = {$/a\\ EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64;" "$PBX_PATH" || true + if ! grep -q "EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64" "$PBX_PATH"; then + awk ' + BEGIN { added=0 } + { + print $0 + if (!added && $0 ~ /buildSettings = {$/) { + print "EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64;" + added=1 + } + } + ' "$PBX_PATH" > "${PBX_PATH}.patched" && mv "${PBX_PATH}.patched" "$PBX_PATH" + fi else echo " - ${PBX_PATH} not found, skipping deployment target patch" fi From 8505a2fba2033b7d80e2692be799694c367a931c Mon Sep 17 00:00:00 2001 From: coturiv Date: Fri, 5 Dec 2025 04:02:27 +0900 Subject: [PATCH 09/10] fix(cordova-ios): avoid invalid pbxproj key; use xcconfig for EXCLUDED_ARCHS --- scripts/patch-ios.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh index c99efae..0ca0146 100644 --- a/scripts/patch-ios.sh +++ b/scripts/patch-ios.sh @@ -31,19 +31,7 @@ for BASE in "${TARGETS[@]}"; do echo " - Updating deployment target in ${PBX_PATH}" "${SED_INPLACE[@]}" "s/IPHONEOS_DEPLOYMENT_TARGET = [0-9]\{1,2\}\.[0-9]\{1,2\} *;/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/g" "$PBX_PATH" || true - echo " - Ensuring simulator excludes arm64 in ${PBX_PATH}" - if ! grep -q "EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64" "$PBX_PATH"; then - awk ' - BEGIN { added=0 } - { - print $0 - if (!added && $0 ~ /buildSettings = {$/) { - print "EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64;" - added=1 - } - } - ' "$PBX_PATH" > "${PBX_PATH}.patched" && mv "${PBX_PATH}.patched" "$PBX_PATH" - fi + # Do not modify pbxproj with sdk-conditional settings; use xcconfig below instead else echo " - ${PBX_PATH} not found, skipping deployment target patch" fi From 7de4040fac4ab20614a845d02729f618118e4261 Mon Sep 17 00:00:00 2001 From: coturiv Date: Fri, 5 Dec 2025 04:15:02 +0900 Subject: [PATCH 10/10] ci(cordova-ios): use absolute xcconfig path; set IPHONEOS_DEPLOYMENT_TARGET in xcconfig --- .github/workflows/ci.yml | 3 ++- scripts/patch-ios.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 169fc70..551c99e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,8 +69,9 @@ jobs: pod --version || true if [ -f platforms/ios/Podfile ]; then (cd platforms/ios && pod install --repo-update); fi # build and instruct Cordova/Xcode to use the xcconfig the script creates + XCOV=$(pwd)/platforms/ios/xcconfigs/ci-overrides.xcconfig ionic cordova build ios --no-interactive -- \ - --buildFlag="-xcconfig platforms/ios/xcconfigs/ci-overrides.xcconfig" \ + --buildFlag="-xcconfig ${XCOV}" \ --buildFlag="-sdk iphonesimulator" \ --buildFlag="-destination generic/platform=iOS Simulator" diff --git a/scripts/patch-ios.sh b/scripts/patch-ios.sh index 0ca0146..54f9e9a 100644 --- a/scripts/patch-ios.sh +++ b/scripts/patch-ios.sh @@ -106,6 +106,7 @@ PODPATCH HEADER_SEARCH_PATHS = $(inherited) $(DERIVED_FILE_DIR)/GeneratedModuleMaps-iphonesimulator EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 ONLY_ACTIVE_ARCH = YES +IPHONEOS_DEPLOYMENT_TARGET = 13.0 XC echo " - Created ${XC_CONFIG_PATH}"