diff --git a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx index d2bcbba2b..ff1b859cc 100644 --- a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx +++ b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx @@ -167,8 +167,10 @@ export class IOSDeviceManager { } } - getSimulators(bootedOnly: boolean): Promise> { - return this.simctlBridge.getActiveDevices(bootedOnly).catch((e: Error) => { + async getSimulators(bootedOnly: boolean): Promise> { + try { + return await this.simctlBridge.getActiveDevices(bootedOnly); + } catch (e) { console.warn('Failed to query simulators:', e); if (e.message.includes('Xcode license agreements')) { this.flipperServer.emit('notification', { @@ -178,8 +180,8 @@ export class IOSDeviceManager { 'The Xcode license agreement has changed. You need to either open Xcode and agree to the terms or run `sudo xcodebuild -license` in a Terminal to allow simulators to work with Flipper.', }); } - return Promise.resolve([]); - }); + return []; + } } private queryDevicesForever(bridge: IOSBridge) {