mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 12:53:31 +02:00
Make it possible to connect to ADB running on other computers.
This commit is contained in:
32
lib/cli.js
32
lib/cli.js
@@ -50,6 +50,14 @@ program
|
||||
, 'heartbeat interval'
|
||||
, Number
|
||||
, 10000)
|
||||
.option('--adb-host <host>'
|
||||
, 'ADB host (defaults to 127.0.0.1)'
|
||||
, String
|
||||
, '127.0.0.1')
|
||||
.option('--adb-port <port>'
|
||||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.action(function() {
|
||||
var serials = cliutil.allUnknownArgs(arguments)
|
||||
, options = cliutil.lastArg(arguments)
|
||||
@@ -83,12 +91,16 @@ program
|
||||
, '--public-ip', options.publicIp
|
||||
, '--group-timeout', options.groupTimeout
|
||||
, '--storage-url', options.storageUrl
|
||||
, '--adb-host', options.adbHost
|
||||
, '--adb-port', options.adbPort
|
||||
])
|
||||
}
|
||||
, endpoints: {
|
||||
sub: options.connectSub
|
||||
, push: options.connectPush
|
||||
}
|
||||
, adbHost: options.adbHost
|
||||
, adbPort: options.adbPort
|
||||
})
|
||||
})
|
||||
|
||||
@@ -118,6 +130,14 @@ program
|
||||
.option('-r, --storage-url <url>'
|
||||
, 'URL to storage client'
|
||||
, String)
|
||||
.option('--adb-host <host>'
|
||||
, 'ADB host (defaults to 127.0.0.1)'
|
||||
, String
|
||||
, '127.0.0.1')
|
||||
.option('--adb-port <port>'
|
||||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.action(function(serial, options) {
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
@@ -146,6 +166,8 @@ program
|
||||
}
|
||||
, groupTimeout: options.groupTimeout * 1000 // change to ms
|
||||
, storageUrl: options.storageUrl
|
||||
, adbHost: options.adbHost
|
||||
, adbPort: options.adbPort
|
||||
})
|
||||
})
|
||||
|
||||
@@ -692,6 +714,14 @@ program
|
||||
, 'public ip for global access'
|
||||
, String
|
||||
, 'localhost')
|
||||
.option('--adb-host <host>'
|
||||
, 'ADB host (defaults to 127.0.0.1)'
|
||||
, String
|
||||
, '127.0.0.1')
|
||||
.option('--adb-port <port>'
|
||||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.action(function() {
|
||||
var log = logger.createLogger('cli:local')
|
||||
, args = arguments
|
||||
@@ -750,6 +780,8 @@ program
|
||||
, '--public-ip', options.publicIp
|
||||
, '--storage-url'
|
||||
, util.format('http://localhost:%d/', options.storagePort)
|
||||
, '--adb-host', options.adbHost
|
||||
, '--adb-port', options.adbPort
|
||||
].concat(cliutil.allUnknownArgs(args)))
|
||||
|
||||
// auth-mock
|
||||
|
||||
Reference in New Issue
Block a user