adb kill-server

Summary: Introduce a new command to allow killing adb

Reviewed By: antonk52

Differential Revision: D47988522

fbshipit-source-id: bb4f17faa7f9b31b9d42e45c0ce39b3f5d98f4b3
This commit is contained in:
Lorenzo Blasa
2023-08-02 07:56:17 -07:00
committed by Facebook GitHub Bot
parent af7c1c7e74
commit d43173a8df
3 changed files with 9 additions and 0 deletions

View File

@@ -295,6 +295,7 @@ export type FlipperServerCommands = {
) => Promise<ClientResponseType>;
'android-get-emulators': () => Promise<string[]>;
'android-launch-emulator': (name: string, coldboot: boolean) => Promise<void>;
'android-adb-kill': () => Promise<void>;
'ios-get-simulators': (bootedOnly: boolean) => Promise<IOSDeviceParams[]>;
'ios-launch-simulator': (udid: string) => Promise<void>;
'ios-idb-kill': () => Promise<void>;

View File

@@ -486,6 +486,10 @@ export class FlipperServerImpl implements FlipperServer {
},
'android-launch-emulator': async (name, coldBoot) =>
launchEmulator(this.config.settings.androidHome, name, coldBoot),
'android-adb-kill': async () => {
assertNotNull(this.android);
return this.android.adbKill();
},
'ios-get-simulators': async (bootedOnly) => {
assertNotNull(this.ios);
return this.ios.getSimulators(bootedOnly);

View File

@@ -267,6 +267,10 @@ export class AndroidDeviceManager {
}
}
async adbKill() {
await this.adbClient.kill();
}
private handleOfflineDevice(device: Device): void {
console.warn(
`[conn] Found device ${device.id}, but it has status offline. If this concerns an emulator and the problem persists, try these potential solutions: https://stackoverflow.com/a/21330228/1983583, https://stackoverflow.com/a/56053223/1983583`,