@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
35 lines • 1.26 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __importDefault(require("../../command"));
const DeviceClient_1 = __importDefault(require("../../DeviceClient"));
const tracker_1 = __importDefault(require("../../tracker"));
class HostTrackDevicesCommand extends command_1.default {
async execute() {
await this._send('host:track-devices');
await this.readOKAY();
return new tracker_1.default(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_1.default(this.connection.parent, id),
};
});
}
}
exports.default = HostTrackDevicesCommand;
//# sourceMappingURL=HostTrackDevicesCommand.js.map