Loading libraries/adb-daemon-webusb/src/device.ts +19 −5 Original line number Diff line number Diff line Loading @@ -105,6 +105,14 @@ export class AdbDaemonWebUsbConnection } #inEndpoint: USBEndpoint; get inEndpoint() { return this.#inEndpoint; } #outEndpoint: USBEndpoint; get outEndpoint() { return this.#outEndpoint; } #readable: ReadableStream<AdbPacketData>; get readable() { Loading @@ -124,6 +132,7 @@ export class AdbDaemonWebUsbConnection ) { this.#device = device; this.#inEndpoint = inEndpoint; this.#outEndpoint = outEndpoint; let closed = false; Loading Loading @@ -313,11 +322,7 @@ export class AdbDaemonWebUsbDevice implements AdbDaemonDevice { this.#usbManager = usbManager; } /** * Claim the device and create a pair of `AdbPacket` streams to the ADB interface. * @returns The pair of `AdbPacket` streams. */ async connect(): Promise<AdbDaemonWebUsbConnection> { async #claimInterface(): Promise<[USBEndpoint, USBEndpoint]> { if (!this.#raw.opened) { await this.#raw.open(); } Loading Loading @@ -352,6 +357,15 @@ export class AdbDaemonWebUsbDevice implements AdbDaemonDevice { const { inEndpoint, outEndpoint } = findUsbEndpoints( alternate.endpoints, ); return [inEndpoint, outEndpoint]; } /** * Claim the device and create a pair of `AdbPacket` streams to the ADB interface. * @returns The pair of `AdbPacket` streams. */ async connect(): Promise<AdbDaemonWebUsbConnection> { const [inEndpoint, outEndpoint] = await this.#claimInterface(); return new AdbDaemonWebUsbConnection( this, inEndpoint, Loading libraries/android-bin/src/logcat.ts +6 −5 Original line number Diff line number Diff line Loading @@ -471,11 +471,12 @@ export class Logcat extends AdbCommandBase { } async clear(ids?: LogId[]) { await this.adb.subprocess.spawnAndWait([ "logcat", "-c", ...(ids ? ["-b", Logcat.joinLogId(ids)] : []), ]); const args = ["logcat", "-c"]; if (ids && ids.length > 0) { args.push("-b", Logcat.joinLogId(ids)); } await this.adb.subprocess.spawnAndWait(args); } binary(options?: LogcatOptions): ReadableStream<AndroidLogEntry> { Loading Loading
libraries/adb-daemon-webusb/src/device.ts +19 −5 Original line number Diff line number Diff line Loading @@ -105,6 +105,14 @@ export class AdbDaemonWebUsbConnection } #inEndpoint: USBEndpoint; get inEndpoint() { return this.#inEndpoint; } #outEndpoint: USBEndpoint; get outEndpoint() { return this.#outEndpoint; } #readable: ReadableStream<AdbPacketData>; get readable() { Loading @@ -124,6 +132,7 @@ export class AdbDaemonWebUsbConnection ) { this.#device = device; this.#inEndpoint = inEndpoint; this.#outEndpoint = outEndpoint; let closed = false; Loading Loading @@ -313,11 +322,7 @@ export class AdbDaemonWebUsbDevice implements AdbDaemonDevice { this.#usbManager = usbManager; } /** * Claim the device and create a pair of `AdbPacket` streams to the ADB interface. * @returns The pair of `AdbPacket` streams. */ async connect(): Promise<AdbDaemonWebUsbConnection> { async #claimInterface(): Promise<[USBEndpoint, USBEndpoint]> { if (!this.#raw.opened) { await this.#raw.open(); } Loading Loading @@ -352,6 +357,15 @@ export class AdbDaemonWebUsbDevice implements AdbDaemonDevice { const { inEndpoint, outEndpoint } = findUsbEndpoints( alternate.endpoints, ); return [inEndpoint, outEndpoint]; } /** * Claim the device and create a pair of `AdbPacket` streams to the ADB interface. * @returns The pair of `AdbPacket` streams. */ async connect(): Promise<AdbDaemonWebUsbConnection> { const [inEndpoint, outEndpoint] = await this.#claimInterface(); return new AdbDaemonWebUsbConnection( this, inEndpoint, Loading
libraries/android-bin/src/logcat.ts +6 −5 Original line number Diff line number Diff line Loading @@ -471,11 +471,12 @@ export class Logcat extends AdbCommandBase { } async clear(ids?: LogId[]) { await this.adb.subprocess.spawnAndWait([ "logcat", "-c", ...(ids ? ["-b", Logcat.joinLogId(ids)] : []), ]); const args = ["logcat", "-c"]; if (ids && ids.length > 0) { args.push("-b", Logcat.joinLogId(ids)); } await this.adb.subprocess.spawnAndWait(args); } binary(options?: LogcatOptions): ReadableStream<AndroidLogEntry> { Loading