diff --git a/lib/cli.js b/lib/cli.js index 555a7857..d6680620 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -76,6 +76,8 @@ program , 'whether to mute master volume when devices are being used') .option('--lock-rotation' , 'whether to lock rotation when devices are being used') + .option('-C, --no-cleanup' + , 'do not attempt to clean up devices between uses') .action(function(serials, options) { if (!options.connectSub) { this.missingArgument('--connect-sub') @@ -116,7 +118,8 @@ program , '--vnc-initial-size', options.vncInitialSize.join('x') ] .concat(options.muteMaster ? ['--mute-master'] : []) - .concat(options.lockRotation ? ['--lock-rotation'] : [])) + .concat(options.lockRotation ? ['--lock-rotation'] : []) + .concat(!options.cleanup ? ['--no-cleanup'] : [])) } , endpoints: { sub: options.connectSub @@ -187,6 +190,8 @@ program , 'whether to mute master volume when devices are being used') .option('--lock-rotation' , 'whether to lock rotation when devices are being used') + .option('-C, --no-cleanup' + , 'do not attempt to clean up devices between uses') .action(function(serial, options) { if (!options.connectSub) { this.missingArgument('--connect-sub') @@ -231,6 +236,7 @@ program , heartbeatInterval: options.heartbeatInterval , muteMaster: options.muteMaster , lockRotation: options.lockRotation + , cleanup: options.cleanup }) }) @@ -1169,6 +1175,8 @@ program , 'whether to mute master volume when devices are being used') .option('--lock-rotation' , 'whether to lock rotation when devices are being used') + .option('-C, --no-cleanup' + , 'do not attempt to clean up devices between uses') .action(function(serials, options) { var log = logger.createLogger('cli:local') var procutil = require('./util/procutil') @@ -1235,6 +1243,7 @@ program .concat(options.allowRemote ? ['--allow-remote'] : []) .concat(options.muteMaster ? ['--mute-master'] : []) .concat(options.lockRotation ? ['--lock-rotation'] : []) + .concat(!options.cleanup ? ['--no-cleanup'] : []) .concat(serials)) // auth diff --git a/lib/units/device/plugins/cleanup.js b/lib/units/device/plugins/cleanup.js index 00b4a33a..fdd2cd9c 100644 --- a/lib/units/device/plugins/cleanup.js +++ b/lib/units/device/plugins/cleanup.js @@ -12,6 +12,10 @@ module.exports = syrup.serial() var log = logger.createLogger('device:plugins:cleanup') var plugin = Object.create(null) + if (!options.cleanup) { + return plugin + } + function listPackages() { return adb.getPackages(options.serial) }