Skip to main content

Create transport

The AdbServerClient#createTransport method creates an AdbTransport for the specified device. The device must have already been authenticated.

The target device can be selected using a DeviceSelector object.

note

See Device selector page for how to create a selector.

declare class AdbServerClient {
createTransport(
device: AdbServerClient.DeviceSelector
): Promise<AdbTransport>;
}

This process is asynchronous, because AdbServerClient needs to fetch some extra information about the device from ADB Server.

The returned AdbTransport object can be used to create an Adb instance.

import { Adb, AdbTransport } from "@yume-chan/adb";

const transport: AdbTransport = await client.createTransport(device);
const adb: Adb = new Adb(transport);
Next Step

See API page for all supported ADB commands.

note

See Server commands page for all supported server commands.