@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
29 lines • 924 B
JavaScript
import Command from '../../command.js';
import DeviceClient from '../../DeviceClient.js';
import Tracker from '../../tracker.js';
export default class HostTrackDevicesCommand extends Command {
async execute() {
await this._send('host:track-devices');
await this.readOKAY();
return new Tracker(this);
}
// copy from HostDevicesCommand.ts
async _readDevices() {
const value = await this.parser.readValue('ascii');
return this._parseDevices(value);
}
_parseDevices(value) {
return value
.split('\n')
.filter((e) => e)
.map((line) => {
const [id, type] = line.split(/\s+/);
return {
id,
type: type,
getClient: () => new DeviceClient(this.connection.parent, id),
};
});
}
}
//# sourceMappingURL=HostTrackDevicesCommand.js.map