lib/scan/runner.rb in scan-0.6.0 vs lib/scan/runner.rb in scan-0.6.1

- old
+ new

@@ -8,10 +8,12 @@ def run handle_results(test_app) end def test_app + open_simulator_for_device(Scan.device) + command = TestCommandGenerator.generate prefix_hash = [ { prefix: "Running Tests: ", block: proc do |value| @@ -73,8 +75,18 @@ report_collector.parse_raw_file(TestCommandGenerator.xcodebuild_log_path) UI.user_error!("Test execution failed. Exit status: #{tests_exit_status}") unless tests_exit_status == 0 UI.user_error!("Tests failed") unless result[:failures] == 0 + end + + def open_simulator_for_device(device) + return unless ENV['FASTLANE_EXPLICIT_OPEN_SIMULATOR'] + + UI.message("Killing all running simulators") + `killall Simulator &> /dev/null` + + UI.message("Explicitly opening simulator for device: #{device.name}") + `open -a Simulator --args -CurrentDeviceUDID #{device.udid}` end end end