Skip to content

Commit 0632422

Browse files
committed
Catch and silence more ADB connection errors
1 parent 37aa041 commit 0632422

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ export async function getConnectedDevices(adbClient: adb.AdbClient) {
2323
.filter(d => d.type !== 'offline')
2424
.map(d => d.id);
2525
} catch (e) {
26-
if (e.code === 'ENOENT') return [];
27-
else {
26+
if (
27+
e.code === 'ENOENT' || // No ADB available
28+
e.code === 'EACCES' || // ADB available, but we aren't allowed to run it
29+
(e.cmd && e.code) // ADB available, but "adb start-server" failed
30+
) {
31+
return [];
32+
} else {
2833
reportError(e);
2934
throw e;
3035
}

0 commit comments

Comments
 (0)