mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 05:53:19 +02:00
Revert all adbkit upgrades (#207)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
var util = require('util')
|
||||
|
||||
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
|
||||
var syrup = require('@devicefarmer/stf-syrup')
|
||||
var ProtoBuf = require('protobufjs')
|
||||
var semver = require('semver')
|
||||
@@ -13,7 +12,6 @@ var logger = require('../../../util/logger')
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../support/adb'))
|
||||
.define(function(options, adb) {
|
||||
var deviceClient = new DeviceClient(adb, options.serial)
|
||||
var log = logger.createLogger('device:resources:service')
|
||||
var builder = ProtoBuf.loadProtoFile(
|
||||
pathutil.vendor('STFService/wire.proto'))
|
||||
@@ -32,7 +30,7 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
function getPath() {
|
||||
return deviceClient.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,7 +46,7 @@ module.exports = syrup.serial()
|
||||
return getPath()
|
||||
.then(function(installedPath) {
|
||||
log.info('Running version check')
|
||||
return deviceClient.shell(util.format(
|
||||
return adb.shell(options.serial, util.format(
|
||||
"export CLASSPATH='%s';" +
|
||||
" exec app_process /system/bin '%s' --version 2>/dev/null"
|
||||
, installedPath
|
||||
@@ -76,11 +74,11 @@ module.exports = syrup.serial()
|
||||
log.info('Installing STFService')
|
||||
// Uninstall first to make sure we don't have any certificate
|
||||
// issues.
|
||||
return deviceClient.uninstall(resource.pkg)
|
||||
return adb.uninstall(options.serial, resource.pkg)
|
||||
.timeout(15000)
|
||||
.then(function() {
|
||||
return promiseutil.periodicNotify(
|
||||
deviceClient.install(resource.apk)
|
||||
adb.install(options.serial, resource.apk)
|
||||
, 20000
|
||||
)
|
||||
.timeout(65000)
|
||||
|
||||
Reference in New Issue
Block a user