@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
22 lines • 737 B
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 RE_OK = /restarting in/;
class TcpIpCommand extends command_1.default {
async execute(port) {
await this._send(`tcpip:${port}`);
await this.readOKAY();
const value = await this.parser.readAll();
if (RE_OK.test(value.toString())) {
return port;
}
else {
throw new Error(value.toString().trim());
}
}
}
exports.default = TcpIpCommand;
//# sourceMappingURL=tcpip.js.map