From 267db1936aa6243e2ad4b461d857a111ca6a47f6 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Thu, 19 Dec 2024 18:58:47 +0100 Subject: [PATCH] Quieten down ADB ENOENT logging --- src/interceptors/android/adb-commands.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/interceptors/android/adb-commands.ts b/src/interceptors/android/adb-commands.ts index cb82dae5..57172c84 100644 --- a/src/interceptors/android/adb-commands.ts +++ b/src/interceptors/android/adb-commands.ts @@ -42,7 +42,15 @@ export function createAdbClient() { // We listen for errors and report them. This only happens if adbkit completely // fails to handle or listen to a connection error. We'd rather report that than crash. - client.on('error', logError); + client.on('error', (e) => { + if (isErrorLike(e) && e.code === 'ENOENT') { + // No ADB available - that's fine, not notable at all + return; + } + + console.log('ADB client error:', e.message ?? e); + logError(e); + }); return client; }