在使用"快速通道扫描"测试 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
从快车道 2.142 开始,您现在可以指定concurrent_workers
指定将在并行测试期间生成的测试运行程序的确切数量。
相当于
-parallel-testing-worker-count
scan(
concurrent_workers: 2
)