adb.js 567 B

123456789101112131415161718
  1. const gfin = require('get-files-in')
  2. const shellExec = require('shell-exec')
  3. module.exports = {
  4. getListOfAPk: () => {
  5. this.apkListToInstall = gfin('./data/apps', matchFiletypes = ["apk"], checkSubDirectories = false)
  6. },
  7. installApk: async () => {
  8. await module.exports.getListOfAPk()
  9. for (let element of this.apkListToInstall) {
  10. await shellExec('adb install -r ' + element).then(function (result) {
  11. console.log('Installing ' + element + ' - ' + result.stdout);
  12. });
  13. }
  14. // console.log(chalk.green('Removal Complete'))
  15. },
  16. };