Browse Source

always kill server

karl.hudgell 4 years ago
parent
commit
abbeb51e1a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pages/pages.js

+ 2 - 1
pages/pages.js

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