From 11d2871893dc21a90eb3ad99a63a9eca2e8a876b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 Feb 2021 03:35:55 -0800 Subject: [PATCH] Reduce error spam from adb start-server Summary: We do have a fall-back for this so there's no need to give this error or even warning treatment. If the fallback fails, we already have a warning. Reviewed By: mweststrate Differential Revision: D26547277 fbshipit-source-id: 96ac91def7e6e111d32d3536d8796f347d6c519d --- desktop/app/src/utils/adbClient.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/utils/adbClient.tsx b/desktop/app/src/utils/adbClient.tsx index 3834b3bca..923c7aacc 100644 --- a/desktop/app/src/utils/adbClient.tsx +++ b/desktop/app/src/utils/adbClient.tsx @@ -8,8 +8,7 @@ */ import {reportPlatformFailures} from './metrics'; -import {promisify} from 'util'; -import child_process from 'child_process'; +import {exec} from 'promisify-child-process'; import promiseRetry from 'promise-retry'; import adbConfig from '../utils/adbConfig'; import adbkit, {Client} from 'adbkit'; @@ -33,12 +32,12 @@ function createClient(store: Store): Promise { const androidHome = store.getState().settingsState.androidHome; const adbPath = path.resolve(androidHome, 'platform-tools/adb'); return reportPlatformFailures( - promisify(child_process.exec)(`${adbPath} start-server`).then(() => + exec(`${adbPath} start-server`).then(() => adbkit.createClient(adbConfig()), ), 'createADBClient.shell', ).catch((err) => { - console.error( + console.log( 'Failed to create adb client using shell adb command. Trying with adbkit.\n' + err.toString(), );