Github actions can not find iOS simulator

Viewed 158

I'm using Github actions + fastlane to do Xcode unit test CI.

Here is the error message i get

Loading...
109
[22:21:09]: ▸ xcodebuild: error: Unable to find a destination matching the provided destination specifier:
110
[22:21:09]: ▸       { platform:iOS Simulator, id:E030085E-DB61-4619-A3EC-87495E2D4867 }
111
[22:21:09]: ▸   Available destinations for the "CIPlaygroundTests" scheme:
112
[22:21:09]: ▸       { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:4203018E-580F-C1B5-9525-B745CECA79EB }
113
[22:21:09]: ▸   Ineligible destinations for the "CIPlaygroundTests" scheme:
114
[22:21:09]: ▸       { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
115
[22:21:09]: ▸       { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
116
[22:21:09]: ▸       { platform:macOS, variant:Mac Catalyst, name:Any Mac }

My github action config

name: build

on: [push, pull_request]

jobs:
  build_test:
    name: Run tests
    runs-on: macos-latest
    defaults:
      run:
        working-directory: CIPlayground
        
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
        
      - name: Select Xcode Version
        uses: maxim-lobanov/setup-xcode@v1
        with:
          xcode-version: latest-stable

    
      - name: Install gem dependencies
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: .ruby-version
          bundler-cache: true
          
      - name: Setup Fastlane
        run: |
          bundle install
          
        
      - name: Run tests
        run: |
          fastlane ios tests ci:github

and Fastlane file

default_platform(:ios)

platform :ios do
  ####### Testing #######

    desc "Runs all the tests"
    lane :tests do
      unit_tests
    end

    desc "Runs all unit tests"
    lane :unit_tests do
      scan(
        scheme: "CIPlaygroundTests",
        devices: ["platform=iOS Simulator,name=iPhone 8"]
      )
    end

end
0 Answers
Related