mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 12:53:31 +02:00
Use 'am stopservice' to stop the input service.
This commit is contained in:
@@ -85,9 +85,10 @@ module.exports = syrup.serial()
|
||||
)
|
||||
}
|
||||
|
||||
function callService(intent) {
|
||||
function callService(cmd, intent) {
|
||||
return adb.shell(options.serial, util.format(
|
||||
'am startservice --user 0 %s'
|
||||
'am %s --user 0 %s'
|
||||
, cmd
|
||||
, intent
|
||||
))
|
||||
.then(function(out) {
|
||||
@@ -137,7 +138,10 @@ module.exports = syrup.serial()
|
||||
return devutil.waitForPortToFree(adb, options.serial, service.port)
|
||||
})
|
||||
.then(function() {
|
||||
return callService(util.format("-a '%s'", service.startAction))
|
||||
return callService(
|
||||
'startservice'
|
||||
, util.format("-a '%s'", service.startAction)
|
||||
)
|
||||
})
|
||||
.then(function() {
|
||||
return devutil.waitForPort(adb, options.serial, service.port)
|
||||
@@ -156,7 +160,10 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
function stopService() {
|
||||
return callService(util.format("-a '%s'", service.stopAction))
|
||||
return callService(
|
||||
'stopservice'
|
||||
, util.format("-a '%s'", service.stopAction)
|
||||
)
|
||||
}
|
||||
|
||||
function sendInputEvent(event) {
|
||||
|
||||
Reference in New Issue
Block a user