working flow for install/uninstall

This commit is contained in:
karl.hudgell 2020-04-25 14:21:45 +01:00
parent 96536414c0
commit 3c31e4838c

View File

@ -8,21 +8,26 @@ module.exports = {
removeApps: async () => {
common.header('Remove Apps')
const value = await inquirer.removeAppsList();
value.removeAppsList.forEach(async (element) => {
await shellExec('adb shell pm uninstall -k --user 0 ' + element).then(async function (result) {
console.log('Removing ' + element + ' - ' + result.stdout)
}).catch()
});
console.log('complete')
for (let element of value.removeAppsList) {
await shellExec('adb shell pm uninstall -k --user 0 ' + element).then(function (result) {
console.log('Removing ' + element + ' - ' + result.stdout);
});
}
console.log(chalk.green('Removal Complete'))
await common.pause(2000)
module.exports.mainMenu()
},
restoreApps: async () => {
common.header('Restore Apps')
common.header('Remove Apps')
const value = await inquirer.removeAppsList();
value.removeAppsList.forEach(element => {
shellExec('adb shell cmd package install-existing ' + element).then(async function (result) {
console.log('Installing ' + element + ' - ' + result.stdout)
}).catch()
});
for (let element of value.removeAppsList) {
await shellExec('adb shell cmd package install-existing ' + element).then(function (result) {
console.log('Removing ' + element + ' - ' + result.stdout);
});
}
console.log(chalk.green('Restore Complete'))
await common.pause(2000)
module.exports.mainMenu()
},
connectWifi: async () => {
common.header('Connect Wifi')