Skip to content

a demo based on VUE #552

Answered by yume-chan
xu123shuai456 asked this question in Q&A
May 6, 2023 · 1 comments · 15 replies
Discussion options

You must be logged in to vote

For 0.0.20:

import { Adb, AdbDaemonTransport } from "@yume-chan/adb";
import AdbWebCredentialStore from "@yume-chan/adb-credential-web";
import { AdbDaemonWebUsbDeviceManager } from "@yume-chan/adb-daemon-webusb";

const CredentialStore = new AdbWebCredentialStore();

const button = document.getElementById("button");
button.addEventListener("click", async () => {
  if (!AdbDaemonWebUsbDeviceManager.BROWSER) {
    alert("WebUSB is not supported in this browser");
    return;
  }

  const backend = await AdbDaemonWebUsbDeviceManager.BROWSER.requestDevice();
  if (!backend) {
    // no device chosen by user
    return;
  }

  const connection = await backend.connect();

  // tell user to acc…

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@xu123shuai456
Comment options

@yume-chan
Comment options

@Muthu-Palaniyappan-OL
Comment options

@yume-chan
Comment options

Answer selected by yume-chan
@meetAndEgg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: question It isn't a bug report, just a question
4 participants
Converted from issue

This discussion was converted from issue #551 on May 06, 2023 06:58.