Skip to content

Commit e36fabb

Browse files
committed
Ignore ECONNREFUSED during ADB setup, and log non-trivial ADB errors
1 parent 1724f15 commit e36fabb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ export const getConnectedDevices = batchCalls(async (adbClient: adb.AdbClient) =
5454
if (
5555
e.code === 'ENOENT' || // No ADB available
5656
e.code === 'EACCES' || // ADB available, but we aren't allowed to run it
57+
e.code === 'ECONNREFUSED' || // Tried to start ADB, but still couldn't connect
5758
(e.cmd && e.code) // ADB available, but "adb start-server" failed
5859
) {
60+
if (e.code !== 'ENOENT') {
61+
console.log(`ADB unavailable, ${e.cmd
62+
? `${e.cmd} exited with ${e.code}`
63+
: `due to ${e.code}`
64+
}`);
65+
}
5966
return [];
6067
} else {
6168
reportError(e);

0 commit comments

Comments
 (0)