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

@@ -1,4 +1,5 @@
var syrup = require('@devicefarmer/stf-syrup')
var DeviceClient = require('@devicefarmer/adbkit/dist/src/adb/DeviceClient').default
var logger = require('../../../util/logger')
var wire = require('../../../wire')
@@ -12,6 +13,7 @@ module.exports = syrup.serial()
.dependency(require('../support/push'))
.dependency(require('../support/adb'))
.define(function(options, service, identity, touch, router, push, adb) {
var deviceClient = new DeviceClient(adb, options.serial)
var log = logger.createLogger('device:plugins:account')
function checkAccount(type, account) {
@@ -281,11 +283,11 @@ module.exports = syrup.serial()
])
})
.catch(function() {
return adb.clear(options.serial, 'com.google.android.gsf.login')
return deviceClient.clear('com.google.android.gsf.login')
.catch(function() {
// The package name is different in 2.3, so let's try the old name
// if the new name fails.
return adb.clear(options.serial, 'com.google.android.gsf')
return deviceClient.clear('com.google.android.gsf')
})
.then(function() {
return service.addAccountMenu()