ya-webadb/libraries/adb-backend-webusb
2022-04-03 12:49:38 +08:00
..
src refactor(adb): let backends deserialize packets by themselves for better optimization 2022-04-03 12:49:38 +08:00
.npmignore chore: experimental moving to rush 2021-05-14 15:31:59 +08:00
CHANGELOG.json chore: create changelog for 0.0.10 2022-01-10 00:25:09 +08:00
CHANGELOG.md chore: create changelog for 0.0.10 2022-01-10 00:25:09 +08:00
LICENSE chore: update license year 2022-01-17 01:27:55 +08:00
package.json refactor(adb): let backends deserialize packets by themselves for better optimization 2022-04-03 12:49:38 +08:00
README.md feat: move more things to stream 2022-02-15 18:42:30 +08:00
tsconfig.json refactor(adb): let backends deserialize packets by themselves for better optimization 2022-04-03 12:49:38 +08:00

@yume-chan/adb-backend-webusb

Backend for @yume-chan/adb using WebUSB (MDN, Spec) API.

Note

WebUSB API requires secure context (basically means HTTPS).

Chrome will treat localhost as secure, but if you want to access a dev server running on another machine, you need to add the domain to the allowlist:

  1. Open chrome://flags/#unsafely-treat-insecure-origin-as-secure
  2. Add the protocol and domain part of your url (e.g. http://192.168.0.100:9000) to the input box
  3. Choose Enable from the dropdown menu
  4. Restart your browser

pickDevice

static async pickDevice(): Promise<AdbWebBackend | undefined>

Request browser to present a list of connected Android devices to let the user choose from.

Returns undefined if the user canceled the picker.

fromDevice

static async fromDevice(device: USBDevice): Promise<AdbWebBackend>

Create an AdbWebBackend instance from an exist USBDevice instance.

read/write

Read/write data from/to the underlying USBDevice instance.