diff --git a/lib/devices/android/chrome.js b/lib/devices/android/chrome.js index 1dca063d..81b92ff0 100644 --- a/lib/devices/android/chrome.js +++ b/lib/devices/android/chrome.js @@ -8,7 +8,6 @@ var Android = require('./android.js') , deviceCommon = require('../common.js') , jwpSuccess = deviceCommon.jwpSuccess , async = require('async') - , ADB = require('./adb.js') , UiAutomator = require('./uiautomator.js'); var NATIVE_WIN = "NATIVE_APP"; @@ -81,13 +80,11 @@ ChromeAndroid.prototype.startAutomation = function (cb) { }; ChromeAndroid.prototype.start = function (cb, onDie) { - this.adb = new ADB(this.args); - this.uiautomator = new UiAutomator(this.adb, this.args); - this.uiautomator.setExitHandler(this.onUiautomatorExit.bind(this)); this.onDieCb = onDie; async.series([ this.initAdb.bind(this), + this.prepareUiAutomator.bind(this), this.initUiautomator.bind(this), this.prepareDevice.bind(this), this.initChromedriverPath.bind(this), @@ -116,6 +113,12 @@ ChromeAndroid.prototype.prepareChromedriver = function (cb) { cb(); }; +ChromeAndroid.prototype.prepareUiAutomator = function (cb) { + this.uiautomator = new UiAutomator(this.adb, this.args); + this.uiautomator.setExitHandler(this.onUiautomatorExit.bind(this)); + cb(); +}; + ChromeAndroid.prototype.pushAndUnlock = function (cb) { this.pushUnlock(function (err) { if (err) return cb(err);