From 7da098f32aa12edd9ec0c97b0b106b7006708282 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Tue, 12 Dec 2023 18:13:20 +0000 Subject: [PATCH] [scan] replace the `simctl boot` command with `simctl bootstatus`, potentially fixing signal kill before running tests (#21026) --- fastlane_core/lib/fastlane_core/device_manager.rb | 4 ++-- fastlane_core/spec/device_manager_spec.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fastlane_core/lib/fastlane_core/device_manager.rb b/fastlane_core/lib/fastlane_core/device_manager.rb index fd2d14af8ae..f45f24342d0 100644 --- a/fastlane_core/lib/fastlane_core/device_manager.rb +++ b/fastlane_core/lib/fastlane_core/device_manager.rb @@ -204,9 +204,9 @@ def boot return unless os_type == "iOS" return if self.state == 'Booted' + # Boot the simulator and wait for it to finish booting UI.message("Booting #{self}") - - `xcrun simctl boot #{self.udid} 2>/dev/null` + `xcrun simctl bootstatus #{self.udid} -b &> /dev/null` self.state = 'Booted' end diff --git a/fastlane_core/spec/device_manager_spec.rb b/fastlane_core/spec/device_manager_spec.rb index 153afb0f480..067f7ed1321 100644 --- a/fastlane_core/spec/device_manager_spec.rb +++ b/fastlane_core/spec/device_manager_spec.rb @@ -512,6 +512,14 @@ device.disable_slide_to_type end + + it "boots the simulator" do + device = FastlaneCore::DeviceManager::Device.new(os_type: "iOS", os_version: "13.0", is_simulator: true, state: nil) + + device.boot + + expect(device.state).to eq('Booted') + end end end end