diff --git a/lib/devices/android/adb.js b/lib/devices/android/adb.js index ad7709395..ddb59fd7e 100644 --- a/lib/devices/android/adb.js +++ b/lib/devices/android/adb.js @@ -648,6 +648,11 @@ ADB.prototype.forwardPort = function (systemPort, devicePort, cb) { this.exec("forward tcp:" + systemPort + " tcp:" + devicePort, cb); }; +ADB.prototype.forwardAbstractPort = function (systemPort, devicePort, cb) { + this.debug("Forwarding system:" + systemPort + " to abstract device:" + devicePort); + this.exec("forward tcp:" + systemPort + " localabstract:" + devicePort, cb); +}; + ADB.prototype.isDeviceConnected = function (cb) { this.getConnectedDevices(function (err, devices) { if (err) { diff --git a/lib/devices/android/android-hybrid.js b/lib/devices/android/android-hybrid.js new file mode 100644 index 000000000..6dcb366ab --- /dev/null +++ b/lib/devices/android/android-hybrid.js @@ -0,0 +1,22 @@ +"use strict"; + +var logger = require('../../server/logger.js').get('appium') + , _ = require('underscore') + , deviceCommon = require('../common.js') + , rd = require('../remote-debugger.js'); + +var getWebviews = function (cb) { + var webviews = []; + this.adb.shell("cat /proc/net/unix", function (err, out) { + _.each(out.split("\n"), function (line) { + if (line.indexOf("@webview_devtools_remote_") !== -1) { + webviews.push(/@(webview_devtools_remote_.+)$/.exec(line)[1]); + } + }); + }); + return webviews; +}; + +var setupPorts = function (localPort, abstractDevicePort, cb) { + this.adb.forwardAbstractPort(localPort, abstractDevicePort, cb); +};