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