diff --git a/desktop/flipper-common/src/server-types.tsx b/desktop/flipper-common/src/server-types.tsx index 56c18982b..31095ca4e 100644 --- a/desktop/flipper-common/src/server-types.tsx +++ b/desktop/flipper-common/src/server-types.tsx @@ -297,6 +297,7 @@ export type FlipperServerCommands = { 'android-launch-emulator': (name: string, coldboot: boolean) => Promise; 'ios-get-simulators': (bootedOnly: boolean) => Promise; 'ios-launch-simulator': (udid: string) => Promise; + 'ios-idb-kill': () => Promise; 'persist-settings': (settings: Settings) => Promise; 'persist-launcher-settings': (settings: LauncherSettings) => Promise; 'keychain-write': (service: string, token: string) => Promise; diff --git a/desktop/flipper-server-core/src/FlipperServerImpl.tsx b/desktop/flipper-server-core/src/FlipperServerImpl.tsx index 0d2c7d609..4a6802cef 100644 --- a/desktop/flipper-server-core/src/FlipperServerImpl.tsx +++ b/desktop/flipper-server-core/src/FlipperServerImpl.tsx @@ -494,6 +494,10 @@ export class FlipperServerImpl implements FlipperServer { assertNotNull(this.ios); return this.ios.simctlBridge.launchSimulator(udid); }, + 'ios-idb-kill': async () => { + assertNotNull(this.ios); + return this.ios.idbKill(); + }, 'persist-settings': async (settings) => saveSettings(settings), 'persist-launcher-settings': async (settings) => saveLauncherSettings(settings), diff --git a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx index 7cc27a598..d2bcbba2b 100644 --- a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx +++ b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx @@ -225,6 +225,14 @@ export class IOSDeviceManager { console.warn('Failed to determine Xcode version:', e); } } + + async idbKill() { + if (!this.idbConfig.idbPath || this.idbConfig.idbPath.length === 0) { + return; + } + const cmd = `${this.idbConfig.idbPath} kill`; + await exec(cmd); + } } function confirmSimulatorAppMatchesThatOfXcodeSelect(