1

I haven't been able to get more than 2 concurrent simulator test devices when testing iOS apps using "fastlane scan".

Doing this "manually" using only xcodebuild works, something like this. This would fire up at most 4 devices:

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

Relevant (but closed(ignored?)) thread: https://github.com/fastlane/fastlane/issues/13394

Here is the lane I'm using

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
Jonny
  • 15,955
  • 18
  • 111
  • 232
  • FWIW it seems that Fastlane yet has poor support for parallel UI testing in general. *shrug* – Jonny Dec 27 '18 at 03:35

1 Answers1

1

Starting with fastlane 2.142, you can now specify concurrent_workers

Specify the exact number of test runners that will be spawned during parallel testing.

Equivalent to -parallel-testing-worker-count

scan(
    concurrent_workers: 2
)
Community
  • 1
  • 1
Ted
  • 22,696
  • 11
  • 95
  • 109