Summary: Introduce a new command to allow killing idb

Reviewed By: lawrencelomax

Differential Revision: D47911709

fbshipit-source-id: 970f1147a177bbcca0bdfa9e9ba970cdc8a914a3
This commit is contained in:
Lorenzo Blasa
2023-07-31 03:55:58 -07:00
committed by Facebook GitHub Bot
parent bf96cc2f15
commit 1f63a25027
3 changed files with 13 additions and 0 deletions

View File

@@ -297,6 +297,7 @@ export type FlipperServerCommands = {
'android-launch-emulator': (name: string, coldboot: boolean) => Promise<void>;
'ios-get-simulators': (bootedOnly: boolean) => Promise<IOSDeviceParams[]>;
'ios-launch-simulator': (udid: string) => Promise<void>;
'ios-idb-kill': () => Promise<void>;
'persist-settings': (settings: Settings) => Promise<void>;
'persist-launcher-settings': (settings: LauncherSettings) => Promise<void>;
'keychain-write': (service: string, token: string) => Promise<void>;

View File

@@ -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),

View File

@@ -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(