Skip to content

Commit ab6e41d

Browse files
committed
Add detailed Android ADB command logging
1 parent ae90fbc commit ab6e41d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,22 @@ async function run(
117117
return Promise.race([
118118
adbClient.shell(command)
119119
.then(adb.util.readAll)
120-
.then((buffer: Buffer) => buffer.toString('utf8')),
120+
.then((buffer: Buffer) => buffer.toString('utf8'))
121+
.then((result) => {
122+
console.debug("Android command", command, "returned", `\`${result.trimEnd()}\``);
123+
return result;
124+
}),
121125
...(options.timeout
122126
? [
123127
delay(options.timeout)
124128
.then(() => { throw new Error(`Timeout for ADB command ${command}`) })
125129
]
126130
: []
127131
)
128-
]);
132+
]).catch((e) => {
133+
console.debug("Android command", command, "threw", e.message);
134+
throw e;
135+
});
129136
}
130137

131138
export async function pushFile(

0 commit comments

Comments
 (0)