GitHub Action in swift workspace



>我正在尝试使用 Github 操作在我的xcworkspace上运行xcodebuild命令。 但是,任何配置都会失败,并显示错误Unable to find a destination matching the provided destination specifier: { platform: iOS Simulator, OS: latest, name:iPhone 11 Pro }

这是我swift.yml文件

name: Unit Tests
on: [push]
jobs:
test:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: List Simulators
run: xcrun instruments -s
- name: Run tests
run: xcodebuild test -workspace "MyWorkspace.xcworkspace" -scheme "MyScheme" -destination "platform=iOS Simulator,name=iPhone 11 Pro,OS=latest"

如您所见,我还记录了 CI 机器上的所有可用设备。这清楚地向我展示了几款iPhone 11 Pro(Max(。

我已经尝试过的事情:

  • 使用特定操作系统版本
  • 较低的构建目标
  • 强制 Xcode 版本为 11.3
  • 上述列表中模拟器的 grep ID,并使用它代替 name 参数
  • 运行测试前的启动模拟器

我错过了什么明显的东西吗?

干杯和快乐编码。

强制 Xcode 版本Xcode 11.3clean test

name: Unit Tests
on: [push]
jobs:
test:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Force Xcode 11
run: sudo xcode-select -switch /Applications/Xcode_11.3.app
- name: List Simulators
run: xcrun instruments -s
- name: Run tests
run: xcodebuild clean test -workspace 'MyWorkspace.xcworkspace' -scheme 'MyScheme' -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest'

最新更新