1

在使用“fastlane scan”测试 iOS 应用程序时,我无法获得超过 2 个并发模拟器测试设备。

仅使用 xcodebuild 可以“手动”执行此操作,就像这样。这将启动最多 4 个设备:

xcodebuild -workspace myapp.xcworkspace -scheme somescheme_debug -destination 'platform=iOS Simulator,OS=12.1,name=iPhone X' build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -parallel-testing-worker-count 4

相关(但已关闭(忽略?))线程:https ://github.com/fastlane/fastlane/issues/13394

这是我正在使用的车道

platform :ios do

  desc "Test"
  lane :test do |values|
    maxconcurrenttestingcount = 4
    schemefortesting = 'somescheme_debug'
    thebranch = git_branch

    ensure_git_status_clean

    puts "Testing, using scheme: '#{schemefortesting}'"

    scan(
      scheme: schemefortesting,
      devices: ['iPhone X'],
      # devices: ['iPhone XS Max'], #, 'iPad Air'],
      max_concurrent_simulators: maxconcurrenttestingcount,
      xcargs: "-parallel-testing-enabled=YES -parallel-testing-worker-count=#{maxconcurrenttestingcount}" # hmm not really working?
    )

    reset_git_repo
  end
end
4

1 回答 1

1

fastlane 2.142开始,您现在可以指定concurrent_workers

指定将在并行测试期间生成的测试运行器的确切数量。

相当于-parallel-testing-worker-count

scan(
    concurrent_workers: 2
)
于 2020-03-17T09:09:10.767 回答