Github actions cannot run iOS tests

1.1k Views Asked by At

Hey I am trying to build a pipeline that should just run all of the tests of my scheme. The problem is that the iPhone simulator that should run the tests is on iOS latest I guess while my projects simulators are on 15.2 ? How can I change that. I have Xcode 13.3 installed and when I go to download additional simulators it only shows 15.2 as the latest.

name: iOS starter workflow

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    name: Build and Test default scheme using any available iPhone simulator
    runs-on: macos-latest
    strategy:
      matrix:
        scheme: ['FlowUs-Production']
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set Default Scheme
        run: |
          default=${{ matrix.scheme }}
          echo $default | cat >default
          echo Using default scheme: $default
      - name: Test
        env:
          scheme: ${{ 'default' }}
          platform: ${{ 'iOS Simulator' }}
        run: |
          # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
          device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
          if [ $scheme = default ]; then scheme=$(cat default); fi
          if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
          file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
          xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"

The output is the following:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
        { platform:iOS Simulator, OS:latest, name:iPhone 11 Simulator }

Available destinations for the "FlowUs-Production" scheme:
        { platform:iOS Simulator, id:6E612B12-333B-4F9E-B75B-99F11EFF00E8, OS:15.2, name:iPad (7th generation) }
        ...
        { platform:iOS Simulator, id:16DB7616-C5B9-4E45-8A9A-71253FF81A9C, OS:15.2, name:iPhone 11 }
        { platform:iOS Simulator, id:146AC047-AC86-4BBF-B6D3-8D08520EDDC9, OS:15.2, name:iPhone 11 Pro }
        { platform:iOS Simulator, id:25A9E533-83F9-418B-BA37-3F3BDB24CE56, OS:15.2, name:iPhone 11 Pro Max }
        { platform:iOS Simulator, id:88E5FE53-731E-4FEC-96A2-C0ED9D4A4DC8, OS:15.2, 
...
name:iPhone SE (2nd generation) }
        { platform:iOS Simulator, id:DD06E861-30D6-4C8C-A7DE-90BE3C0FFD96, OS:15.2, name:iPod touch (7th generation) }

    Ineligible destinations for the "FlowUs-Production" scheme:
        { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
        { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
0

There are 0 best solutions below