Revert "Fix adbkit API invocations (#524)" (#528)

This reverts commit 6f09708304.
This commit is contained in:
Karol Wrótniak
2022-05-12 10:08:47 +02:00
committed by GitHub
parent eacc7bbca7
commit e60bcee3fc
14 changed files with 11377 additions and 11710 deletions

View File

@@ -3,7 +3,6 @@ var util = require('util')
var syrup = require('@devicefarmer/stf-syrup')
var ProtoBuf = require('protobufjs')
var semver = require('semver')
var deviceClient = require('@devicefarmer/adbkit').DeviceClient
var pathutil = require('../../../util/pathutil')
var streamutil = require('../../../util/streamutil')
@@ -31,8 +30,7 @@ module.exports = syrup.serial()
}
function getPath() {
var client = deviceClient(adb, options.serial)
return client.shell(['pm', 'path', resource.pkg])
return adb.shell(options.serial, ['pm', 'path', resource.pkg])
.timeout(10000)
.then(function(out) {
return streamutil.findLine(out, (/^package:/))
@@ -48,8 +46,7 @@ module.exports = syrup.serial()
return getPath()
.then(function(installedPath) {
log.info('Running version check')
var client = deviceClient(adb, options.serial)
return client.shell(util.format(
return adb.shell(options.serial, util.format(
"export CLASSPATH='%s';" +
" exec app_process /system/bin '%s' --version 2>/dev/null"
, installedPath
@@ -77,13 +74,11 @@ module.exports = syrup.serial()
log.info('Installing STFService')
// Uninstall first to make sure we don't have any certificate
// issues.
var client = deviceClient(adb, options.serial)
return client.uninstall(resource.pkg)
return adb.uninstall(options.serial, resource.pkg)
.timeout(15000)
.then(function() {
return promiseutil.periodicNotify(
client.install(resource.apk)
adb.install(options.serial, resource.apk)
, 20000
)
.timeout(65000)