mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-17 23:53:25 +02:00
@@ -3,6 +3,7 @@ var util = require('util')
|
||||
var split = require('split')
|
||||
var Promise = require('bluebird')
|
||||
var androidDeviceList = require('android-device-list')
|
||||
var deviceClient = require('@devicefarmer/adbkit').DeviceClient
|
||||
|
||||
var devutil = module.exports = Object.create(null)
|
||||
|
||||
@@ -71,7 +72,8 @@ devutil.listPidsByComm = function(adb, serial, comm, bin) {
|
||||
})
|
||||
}
|
||||
|
||||
return adb.shell(serial, 'ps 2>/dev/null')
|
||||
var client = deviceClient(adb, serial)
|
||||
return client.shell('ps 2>/dev/null')
|
||||
.then(findProcess)
|
||||
.then(function(res) {
|
||||
// return pids if process can be found in the output of 'ps' command
|
||||
@@ -81,7 +83,7 @@ devutil.listPidsByComm = function(adb, serial, comm, bin) {
|
||||
}
|
||||
// otherwise try to run 'ps -elf'
|
||||
else {
|
||||
return adb.shell(serial, 'ps -lef 2>/dev/null')
|
||||
return client.shell('ps -lef 2>/dev/null')
|
||||
.then(findProcess)
|
||||
.then(function(res) {
|
||||
return Promise.resolve(res.pids)
|
||||
|
||||
Reference in New Issue
Block a user