stub out some functions used to get webviews going on android

This commit is contained in:
Jonathan Lipps
2014-02-24 14:59:39 -08:00
parent a2ad225069
commit a698e19d2c
2 changed files with 27 additions and 0 deletions
+5
View File
@@ -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) {
+22
View File
@@ -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);
};