mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-17 23:53:25 +02:00
Revert all adbkit upgrades (#207)
This commit is contained in:
@@ -2,7 +2,6 @@ var stream = require('stream')
|
||||
var url = require('url')
|
||||
var util = require('util')
|
||||
|
||||
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
|
||||
var syrup = require('@devicefarmer/stf-syrup')
|
||||
var request = require('request')
|
||||
var Promise = require('bluebird')
|
||||
@@ -24,7 +23,6 @@ module.exports = syrup.serial()
|
||||
.dependency(require('../support/router'))
|
||||
.dependency(require('../support/push'))
|
||||
.define(function(options, adb, router, push) {
|
||||
var deviceClient = new DeviceClient(adb, options.serial)
|
||||
var log = logger.createLogger('device:plugins:install')
|
||||
|
||||
router.on(wire.InstallMessage, function(channel, message) {
|
||||
@@ -57,7 +55,7 @@ module.exports = syrup.serial()
|
||||
var source = new stream.Readable().wrap(req)
|
||||
var target = '/data/local/tmp/_app.apk'
|
||||
|
||||
return deviceClient.push(source, target)
|
||||
return adb.push(options.serial, source, target)
|
||||
.timeout(10000)
|
||||
.then(function(transfer) {
|
||||
var resolver = Promise.defer()
|
||||
@@ -105,7 +103,7 @@ module.exports = syrup.serial()
|
||||
|
||||
sendProgress('installing_app', guesstimate)
|
||||
return promiseutil.periodicNotify(
|
||||
deviceClient.installRemote(apk)
|
||||
adb.installRemote(options.serial, apk)
|
||||
.timeout(60000 * 5)
|
||||
.catch(function(err) {
|
||||
switch (err.code) {
|
||||
@@ -115,10 +113,10 @@ module.exports = syrup.serial()
|
||||
'Uninstalling "%s" first due to inconsistent certificates'
|
||||
, pkg
|
||||
)
|
||||
return deviceClient.uninstall(pkg)
|
||||
return adb.uninstall(options.serial, pkg)
|
||||
.timeout(15000)
|
||||
.then(function() {
|
||||
return deviceClient.installRemote(apk)
|
||||
return adb.installRemote(options.serial, apk)
|
||||
.timeout(60000 * 5)
|
||||
})
|
||||
default:
|
||||
@@ -164,7 +162,7 @@ module.exports = syrup.serial()
|
||||
)
|
||||
// Progress 90%
|
||||
sendProgress('launching_app', 90)
|
||||
return deviceClient.startActivity(launchActivity)
|
||||
return adb.startActivity(options.serial, launchActivity)
|
||||
.timeout(30000)
|
||||
}
|
||||
}
|
||||
@@ -207,7 +205,7 @@ module.exports = syrup.serial()
|
||||
|
||||
var reply = wireutil.reply(options.serial)
|
||||
|
||||
deviceClient.uninstall(message.packageName)
|
||||
adb.uninstall(options.serial, message.packageName)
|
||||
.then(function() {
|
||||
push.send([
|
||||
channel
|
||||
|
||||
Reference in New Issue
Block a user