always kill server

This commit is contained in:
karl.hudgell 2020-04-30 15:47:37 +01:00
parent 5939508500
commit abbeb51e1a

View File

@ -166,6 +166,7 @@ module.exports = {
const miwatchData = JSON.parse(fs.readFileSync('./data/MiWatch.json', 'utf8')); const miwatchData = JSON.parse(fs.readFileSync('./data/MiWatch.json', 'utf8'));
common.header('Connect Wifi') common.header('Connect Wifi')
if (miwatchData.ipAddress !== "") { if (miwatchData.ipAddress !== "") {
await shellExec(adbRun + ' kill-server')
console.log('Trying to connect with stored ipAddress') console.log('Trying to connect with stored ipAddress')
shellExec(adbRun + ' connect ' + miwatchData.ipAddress).then(async function (result) { shellExec(adbRun + ' connect ' + miwatchData.ipAddress).then(async function (result) {
logger.info("Connect Wifi Result " + result.stdout) logger.info("Connect Wifi Result " + result.stdout)
@ -184,7 +185,7 @@ module.exports = {
} }
}).catch() }).catch()
} else { } else {
await shellExec(adbRun + ' kill-server')
const value = await inquirer.connectWifi(); const value = await inquirer.connectWifi();
const miWatchIpaddress = value.connectWifi const miWatchIpaddress = value.connectWifi
shellExec(adbRun + ' connect ' + miWatchIpaddress).then(async function (result) { shellExec(adbRun + ' connect ' + miWatchIpaddress).then(async function (result) {