JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 809
  • Score
    100M100P100Q128499F
  • License MIT

Backend for `@yume-chan/adb` using WebUSB API.

Package Exports

  • @yume-chan/adb-backend-webusb
  • @yume-chan/adb-backend-webusb/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yume-chan/adb-backend-webusb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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.

connect

async connect(): Promise<ReadableWritablePair<AdbPacketCore, AdbPacketInit>>

Connect to a device and create a pair of AdbPacket streams.