From b3de081f685d479072de93372886a8f25ff42dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Fri, 13 Sep 2019 05:25:36 -0700 Subject: [PATCH] clear logs Summary: - clear logs using executeShell - remove unused spawnShell Reviewed By: jknoxville Differential Revision: D17343235 fbshipit-source-id: 4353b2ebc00e35b31e815e405534a78b65a3eabb --- src/devices/AndroidDevice.tsx | 8 ++------ src/devices/BaseDevice.tsx | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/devices/AndroidDevice.tsx b/src/devices/AndroidDevice.tsx index a46724bba..b65e59dc1 100644 --- a/src/devices/AndroidDevice.tsx +++ b/src/devices/AndroidDevice.tsx @@ -77,13 +77,9 @@ export default class AndroidDevice extends BaseDevice { }); } - spawnShell(): DeviceShell | null | undefined { - return child_process.spawn('adb', ['-s', this.serial, 'shell', '-t', '-t']); - } - clearLogs(): Promise { this.logEntries = []; - return spawn('adb', ['logcat', '-c']).then(_ => undefined); + return this.executeShell(['logcat', '-c']); } archive(): ArchivedDevice { @@ -126,7 +122,7 @@ export default class AndroidDevice extends BaseDevice { } } - private async executeShell(command: string): Promise { + private async executeShell(command: string | string[]): Promise { const output = await this.adb .shell(this.serial, command) .then(adb.util.readAll) diff --git a/src/devices/BaseDevice.tsx b/src/devices/BaseDevice.tsx index 07666c14e..e6be9323d 100644 --- a/src/devices/BaseDevice.tsx +++ b/src/devices/BaseDevice.tsx @@ -135,10 +135,6 @@ export default class BaseDevice { this.logListeners.delete(id); } - spawnShell(): DeviceShell | null | undefined { - throw new Error('unimplemented'); - } - navigateToLocation(location: string) { throw new Error('unimplemented'); }