diff --git a/lib/cli.js b/lib/cli.js index ff098236..55098049 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -50,6 +50,14 @@ program , 'heartbeat interval' , Number , 10000) + .option('--adb-host ' + , 'ADB host (defaults to 127.0.0.1)' + , String + , '127.0.0.1') + .option('--adb-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 to storage client' , String) + .option('--adb-host ' + , 'ADB host (defaults to 127.0.0.1)' + , String + , '127.0.0.1') + .option('--adb-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 ' + , 'ADB host (defaults to 127.0.0.1)' + , String + , '127.0.0.1') + .option('--adb-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 diff --git a/lib/roles/device/support/adb.js b/lib/roles/device/support/adb.js index f00369af..e2545952 100644 --- a/lib/roles/device/support/adb.js +++ b/lib/roles/device/support/adb.js @@ -8,7 +8,10 @@ var promiseutil = require('../../../util/promiseutil') module.exports = syrup.serial() .define(function(options) { var log = logger.createLogger('device:support:adb') - var adb = adbkit.createClient() + var adb = adbkit.createClient({ + host: options.adbHost + , port: options.adbPort + }) adb.Keycode = adbkit.Keycode function ensureBootComplete() { diff --git a/lib/roles/provider.js b/lib/roles/provider.js index fd0b3311..52eeb9c5 100644 --- a/lib/roles/provider.js +++ b/lib/roles/provider.js @@ -14,7 +14,10 @@ var lifecycle = require('../util/lifecycle') module.exports = function(options) { var log = logger.createLogger('provider') - var client = adb.createClient() + var client = adb.createClient({ + host: options.adbHost + , port: options.adbPort + }) var workers = {} var solo = wireutil.makePrivateChannel() var lists = {