Skip to content

Commit 3b709ab

Browse files
committed
Don't log noisey "adb already running as root" messages
1 parent 70193be commit 3b709ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ export async function getRootCommand(adbClient: adb.AdbClient, deviceId: string)
141141
// If no explicit root commands are available, try to restart adb in root
142142
// mode instead. If this works, *all* commands will run as root.
143143
// We prefer explicit "su" calls if possible, to limit access & side effects.
144-
await adbClient.root(deviceId).catch(console.log);
144+
await adbClient.root(deviceId).catch((e) => {
145+
if (e.message && e.message.includes("adbd is already running as root")) return;
146+
else console.log(e);
147+
});
145148

146149
// Sometimes switching to root can disconnect ADB devices, so double-check
147150
// they're still here, and wait a few seconds for them to come back if not.

0 commit comments

Comments
 (0)