diff --git a/scan/lib/scan/test_command_generator.rb b/scan/lib/scan/test_command_generator.rb index 42c297600c0..2a7dca79ab0 100644 --- a/scan/lib/scan/test_command_generator.rb +++ b/scan/lib/scan/test_command_generator.rb @@ -45,7 +45,9 @@ def options # rubocop:disable Metrics/PerceivedComplexity options << "-enableCodeCoverage #{config[:code_coverage] ? 'YES' : 'NO'}" unless config[:code_coverage].nil? options << "-enableAddressSanitizer #{config[:address_sanitizer] ? 'YES' : 'NO'}" unless config[:address_sanitizer].nil? options << "-enableThreadSanitizer #{config[:thread_sanitizer] ? 'YES' : 'NO'}" unless config[:thread_sanitizer].nil? - options << "-testPlan #{config[:testplan]}" if config[:testplan] + if FastlaneCore::Helper.xcode_at_least?(11) + options << "-testPlan #{config[:testplan]}" if config[:testplan] + end options << "-xctestrun '#{config[:xctestrun]}'" if config[:xctestrun] options << config[:xcargs] if config[:xcargs] diff --git a/scan/spec/test_command_generator_spec.rb b/scan/spec/test_command_generator_spec.rb index 95b266ef48b..5cd0573ef05 100644 --- a/scan/spec/test_command_generator_spec.rb +++ b/scan/spec/test_command_generator_spec.rb @@ -624,7 +624,7 @@ log_path = File.expand_path("~/Library/Logs/scan/app-app.log") result = @test_command_generator.generate - expect(result).to include("-testPlan simple") + expect(result).to include("-testPlan simple") if FastlaneCore::Helper.xcode_at_least?(10) end end end