diff --git a/lib/roles/device.js b/lib/roles/device.js index 4e470b04..0da81f0c 100644 --- a/lib/roles/device.js +++ b/lib/roles/device.js @@ -74,7 +74,20 @@ module.exports = function(options) { }) .then(function() { log.info('Checking if any processes from a previous run are still up') - return devutil.killProcsByBin(adb, options.serial, vendor.bin.dest) + return Promise.all([ + devutil.killProcsByComm( + adb + , options.serial + , vendor.bin.comm + , vendor.bin.dest + ) + , devutil.killProcsByComm( + adb + , options.serial + , 'commands.monkey' + , 'com.android.commands.monkey' + ) + ]) }) .then(function() { var port = 2870 diff --git a/lib/util/devutil.js b/lib/util/devutil.js index fe6297a2..8eaa221d 100644 --- a/lib/util/devutil.js +++ b/lib/util/devutil.js @@ -1,5 +1,4 @@ var util = require('util') -var path = require('path') var split = require('split') var Promise = require('bluebird') @@ -15,6 +14,7 @@ devutil.vendorFiles = function(identity) { src: pathutil.vendor(util.format( 'remote/libs/%s/remote', identity.abi)) , dest: '/data/local/tmp/remote' + , comm: 'remote' , mode: 0755 } , lib: { @@ -26,9 +26,8 @@ devutil.vendorFiles = function(identity) { } } -devutil.killProcsByBin = function(adb, serial, bin) { - var basename = path.basename(bin) - return adb.shellAsync(serial, ['ps', basename]) +devutil.killProcsByComm = function(adb, serial, comm, bin) { + return adb.shellAsync(serial, ['ps', comm]) .then(function(out) { return new Promise(function(resolve, reject) { var header = false