如何使用fastlane重置特定Xcode版本的模拟器?

如何使用fastlane重置特定Xcode版本的模拟器?,xcode,fastlane,Xcode,Fastlane,在gitlab ci.yml中,我有: test: stage: test before_script: - killall "Simulator" || true script: //how can I select proper xcode here? - bundle exec fastlane snapshot reset_simulators --force - bundle exec fastlane test after_script

gitlab ci.yml
中,我有:

test: stage: test before_script: - killall "Simulator" || true script: //how can I select proper xcode here? - bundle exec fastlane snapshot reset_simulators --force - bundle exec fastlane test after_script: - killall "Simulator" || true - rm -rf ~/Library/Developer/Xcode/Archives || true artifacts: name: "Staff_${CI_PIPELINE_ID}" paths: - fastlane/output/coverage when: on_success tags: - iOS 测试: 阶段:测试 在脚本之前: -killall“模拟器”| |正确 脚本: //我如何在这里选择合适的xcode? -bundle exec fastlane快照重置\u模拟器-强制 -bundle-exec快速通道测试 在脚本之后: -killall“模拟器”| |正确 -rm-rf~/Library/Developer/Xcode/Archives | | true 人工产品: 名称:“职员${CI_管道{u ID}” 路径: -快车道/输出/覆盖 何时:关于成功 标签: -iOS 我为什么需要这样做?


因为
reset\u模拟器--force
为不同于我使用的xcode版本重置模拟器;)如何强制它选择好的xcode版本?

看起来您有自己的
Fastfile
,它有您的
测试通道。我建议你在那里重置模拟器。然后在重置之前添加呼叫

例如:

lane :test do
  xcode_select('/Applications/Xcode9.4.1.app')
  Snapshot::ResetSimulators.clear_everything!(nil, true) # what reset_simulators ends up calling
  # your other code
end

您是否尝试过fastlane操作“重置模拟器内容”


这将重置测试机器上运行的所有模拟器。

如果您想将其用于
扫描
运行测试

它现在支持
reset\u模拟器

启用此选项将在运行应用程序之前自动擦除模拟器

扫描复位模拟器

就打电话

xcversion(version: 11.0)
run_tests(
    reset_simulator: true
)