diff --git a/docs/en/writing-running-appium/mobile-web.md b/docs/en/writing-running-appium/mobile-web.md index 003e0f2ab..75b8f439d 100644 --- a/docs/en/writing-running-appium/mobile-web.md +++ b/docs/en/writing-running-appium/mobile-web.md @@ -233,3 +233,16 @@ capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome"); ``` Note that on 4.4+ devices, you can also use the 'Browser' `browserName` cap to automate the built-in browser. On all devices you can use the 'Chromium' `browserName` cap to automate a build of Chromium. + +#### Troubleshooting chromedriver + +As of Chrome version 33, a rooted device is no longer required. If running tests on older versions of Chrome, devices needed to be rooted as ChromeDriver required write access to the /data/local directory +to set Chrome's command line arguments. + +If testing on Chrome app prior to version 33, ensure adb shell has read/write access to /data/local directory on the device: + +```center +$ adb shell su -c chmod 777 /data/local +``` + +For more chromedriver specific documentation see [ChromeDriver documentation](https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android). diff --git a/lib/devices/android/chrome.js b/lib/devices/android/chrome.js index 2accea3a2..18dab2b81 100644 --- a/lib/devices/android/chrome.js +++ b/lib/devices/android/chrome.js @@ -107,7 +107,10 @@ ChromeAndroid.prototype.createSession = function (cb) { ChromeAndroid.prototype.stop = function (cb) { this.chromedriver.stop(function (err) { if (err) return cb(err); - this.adb.forceStop(this.args.appPackage, cb); + this.adb.forceStop(this.args.appPackage, function (err) { + if (err) return cb(err); + this.adb.stopLogcat(cb); + }.bind(this)); }.bind(this)); }; @@ -117,7 +120,7 @@ ChromeAndroid.prototype.onChromedriverExit = function () { _.partial(this.adb.forceStop.bind(this.adb), this.args.appPackage) ], function (err) { if (err) logger.error(err.message); - this.onDie(); + this.adb.stopLogcat(this.onDie()); }.bind(this)); };