diff --git a/.github/actions/setup_simulator/action.yml b/.github/actions/setup_simulator/action.yml deleted file mode 100644 index 3eecbe12c..000000000 --- a/.github/actions/setup_simulator/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: Temporary local copy of firebase/firebase-ios-sdk's setup_simulator -# composite action. Consolidate to reference -# `firebase/firebase-ios-sdk/.github/actions/setup_simulator` once upstream -# resolves its script path via `$GITHUB_ACTION_PATH` instead of -# `github.workspace` and supports `macOS|catalyst` as a no-op. - -name: 'Setup Simulator' -description: 'Creates a standardized simulator matching the active Xcode runtime.' -inputs: - platform: - description: 'The platform to create a simulator for (iOS, tvOS, watchOS, visionOS, all). Default is all.' - required: false - default: 'all' - -runs: - using: "composite" - steps: - - name: Run Simulator Setup Script - shell: bash - env: - PLATFORM: ${{ inputs.platform }} - run: | - bash "$GITHUB_WORKSPACE/scripts/setup_simulator.sh" "$PLATFORM" diff --git a/.github/workflows/abtesting.yml b/.github/workflows/abtesting.yml index 3f9489211..04e94e415 100644 --- a/.github/workflows/abtesting.yml +++ b/.github/workflows/abtesting.yml @@ -77,7 +77,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/analytics.yml b/.github/workflows/analytics.yml index ef91efdcf..e5895adf6 100644 --- a/.github/workflows/analytics.yml +++ b/.github/workflows/analytics.yml @@ -70,7 +70,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/authentication.yml b/.github/workflows/authentication.yml index f09e1391e..8fb5b87e4 100644 --- a/.github/workflows/authentication.yml +++ b/.github/workflows/authentication.yml @@ -57,7 +57,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 96f8c9a22..f10dcd570 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -56,7 +56,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/crashlytics.yml b/.github/workflows/crashlytics.yml index 28f89a8ac..f26de7f42 100644 --- a/.github/workflows/crashlytics.yml +++ b/.github/workflows/crashlytics.yml @@ -65,7 +65,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 0424bc338..6fb47954a 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -56,7 +56,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup @@ -100,7 +100,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/firebaseai.yml b/.github/workflows/firebaseai.yml index 1f6ae5e55..45b3e272d 100644 --- a/.github/workflows/firebaseai.yml +++ b/.github/workflows/firebaseai.yml @@ -47,7 +47,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index d23ba98ed..a89451041 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -59,7 +59,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index d3f170c29..6f481a3f4 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -57,7 +57,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/inappmessaging.yml b/.github/workflows/inappmessaging.yml index 3584da1d8..ed64c42e0 100644 --- a/.github/workflows/inappmessaging.yml +++ b/.github/workflows/inappmessaging.yml @@ -55,7 +55,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/installations.yml b/.github/workflows/installations.yml index 783ea5340..e52ccaee4 100644 --- a/.github/workflows/installations.yml +++ b/.github/workflows/installations.yml @@ -55,7 +55,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/messaging.yml b/.github/workflows/messaging.yml index 738190d03..41fd3f00a 100644 --- a/.github/workflows/messaging.yml +++ b/.github/workflows/messaging.yml @@ -55,7 +55,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 5402f8f95..d97c0b371 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -56,7 +56,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: iOS - name: Setup @@ -101,7 +101,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 9d169351d..3c2558505 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -57,7 +57,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: Setup simulator - uses: ./.github/actions/setup_simulator + uses: firebase/firebase-ios-sdk/.github/actions/setup_simulator@e1e760d7ab3a985cd590f284ad632afc7d192924 # main with: platform: ${{ matrix.os }} - name: Setup diff --git a/scripts/setup_simulator.sh b/scripts/setup_simulator.sh deleted file mode 100755 index b3b5e9b8a..000000000 --- a/scripts/setup_simulator.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: Temporary local copy of firebase/firebase-ios-sdk/scripts/setup_simulator.sh -# (with SDK-major runtime matching and `macOS|catalyst` no-op support). -# Consolidate once upstream `firebase-ios-sdk` supports cross-repo composite -# action invocation. - -set -euo pipefail - -PLATFORM="${1:-all}" - -echo " Active Xcode Info:" -xcodebuild -version -echo " Installed Simulator Runtimes:" -xcrun simctl list runtimes - -get_runtime() { - local platform_prefix="$1" - local sdk_name="" - case "$platform_prefix" in - iOS) sdk_name="iphonesimulator" ;; - tvOS) sdk_name="appletvsimulator" ;; - watchOS) sdk_name="watchsimulator" ;; - visionOS) sdk_name="xrsimulator" ;; - esac - - # Match the latest installed runtime for the active SDK's major version so it - # aligns with xcodebuild's implicit `OS:latest` destination resolution (e.g., - # selecting iOS 26.5 on macos-26 when 26.2, 26.4, and 26.5 are installed). - local target_major="" - if [[ -n "$sdk_name" ]]; then - local sdk_ver - sdk_ver=$(xcrun --sdk "$sdk_name" --show-sdk-version 2>/dev/null || true) - if [[ -n "$sdk_ver" ]]; then - target_major="${sdk_ver%%.*}" - fi - fi - - local runtime="" - if [[ -n "$target_major" ]]; then - runtime=$(xcrun simctl list runtimes available | grep "^[[:space:]]*${platform_prefix} ${target_major}\." | grep -o "com\.apple\.CoreSimulator\.SimRuntime\.${platform_prefix}-[0-9-]*" | tail -n 1 || true) - fi - - if [[ -z "$runtime" ]]; then - runtime=$(xcrun simctl list runtimes available | grep "^[[:space:]]*${platform_prefix}" | grep -o "com\.apple\.CoreSimulator\.SimRuntime\.${platform_prefix}-[0-9-]*" | tail -n 1 || true) - fi - - echo "$runtime" -} - -create_sim() { - local sim_name="$1" - local runtime="$2" - shift 2 - local device_types=("$@") - - if [[ -z "$runtime" ]]; then - echo "âš ī¸ Warning: No available runtime found for $sim_name. Skipping creation." - return 0 - fi - - if xcrun simctl list devices available | grep -Fq "${sim_name} ("; then - echo "✅ Simulator '$sim_name' already exists and is available." - else - # Clean up any existing (but unavailable) simulators with the same name to avoid duplicates - xcrun simctl list devices | grep -F "${sim_name} (" | grep -oE '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}' | while read -r uuid; do - echo "🧹 Removing existing/unavailable simulator $uuid..." - xcrun simctl delete "$uuid" || true - done || true - - local created=false - for device_type in "${device_types[@]}"; do - echo "📲 Attempting to create '$sim_name' with type '$device_type' and runtime '$runtime'..." - if xcrun simctl create "$sim_name" "$device_type" "$runtime" 2>/dev/null; then - echo "✅ Successfully created '$sim_name' using '$device_type'." - created=true - break - else - echo "âš ī¸ Device type '$device_type' is incompatible with '$runtime' or unavailable." - fi - done - - if [[ "$created" = false ]]; then - echo "❌ Failed to create simulator '$sim_name' with any provided device types." - return 1 - fi - fi -} - -case "$PLATFORM" in - iOS) - create_sim "Firebase-iPhone-15-Pro" "$(get_runtime iOS)" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-Duo" - ;; - tvOS) - create_sim "Firebase-Apple-TV-4K-Gen-2" "$(get_runtime tvOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-2nd-generation-1080p" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-1080p" - ;; - watchOS) - create_sim "Firebase-Apple-Watch-Ultra-2" "$(get_runtime watchOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-2-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-3-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-4-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-SE-3-44mm" - ;; - visionOS) - create_sim "Firebase-Apple-Vision-Pro" "$(get_runtime visionOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro" - ;; - macOS|catalyst) - echo "â„šī¸ Platform '$PLATFORM' does not require a simulator." - ;; - all) - create_sim "Firebase-iPhone-15-Pro" "$(get_runtime iOS)" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro" \ - "com.apple.CoreSimulator.SimDeviceType.iPhone-Duo" - create_sim "Firebase-Apple-TV-4K-Gen-2" "$(get_runtime tvOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-2nd-generation-1080p" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-1080p" - create_sim "Firebase-Apple-Watch-Ultra-2" "$(get_runtime watchOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-2-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-3-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Ultra-4-49mm" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-SE-3-44mm" - create_sim "Firebase-Apple-Vision-Pro" "$(get_runtime visionOS)" \ - "com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro" - ;; - *) - echo "❌ Unknown platform: $PLATFORM" - exit 1 - ;; -esac diff --git a/scripts/test.sh b/scripts/test.sh index d51922ae7..2e65c8d29 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -52,12 +52,6 @@ if [[ -z "${TEST:-}" ]]; then echo "Defaulting to TEST=$TEST" fi -if [[ "$OS" == "iOS" || "$OS" == "tvOS" || "$OS" == "watchOS" ]]; then - if [[ "$DEVICE" == Firebase-* ]] && ! xcrun simctl list devices available | grep -Fq "${DEVICE} ("; then - bash ./scripts/setup_simulator.sh "$OS" - fi -fi - # Set have_secrets to true or false. have_secrets=false # shellcheck disable=SC1091