Fix adb invocations (#202)

This commit is contained in:
Karol Wrótniak
2021-03-10 14:50:33 +01:00
committed by GitHub
parent 50ee38c2ce
commit 5dfdd9ac63
18 changed files with 79 additions and 43 deletions

View File

@@ -4,6 +4,7 @@ var syrup = require('@devicefarmer/stf-syrup')
var logger = require('../../../util/logger')
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
module.exports = syrup.serial()
.dependency(require('../support/adb'))
@@ -11,6 +12,7 @@ module.exports = syrup.serial()
.dependency(require('../support/push'))
.dependency(require('../support/sub'))
.define(function(options, adb, router, push, sub) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:plugins:shell')
router.on(wire.ShellCommandMessage, function(channel, message) {
@@ -18,7 +20,7 @@ module.exports = syrup.serial()
log.info('Running shell command "%s"', message.command)
adb.shell(options.serial, message.command)
deviceClient.shell(message.command)
.timeout(10000)
.then(function(stream) {
var resolver = Promise.defer()