appium:Could not detect Mac OS X version
2016-07-03 22:19
330 查看
使用appium-doctor检查出Could not detect Mac OS X version,原因是appium还没兼容10.10以上的系统。
但是只需要在/usr/local/lib/node_modules/appium/lib/doctor/ios.js改一下相应的配置就可以了。
IOSChecker.prototype.getMacOSXVersion = function (cb) {
exec("sw_vers -productVersion", function (err, stdout) {
if (err === null) {
if (stdout.match('10.8') !== null) {
this.osVersion = '10.8';
cb(null, "Mac OS X 10.8 is installed.");
} else if (stdout.match('10.9') !== null) {
this.osVersion = '10.9';
cb(null, "Mac OS X 10.9 is installed.");
} else if ((stdout.match('10.10') !== null) || (stdout.match('10.10.1') !== null)) {
this.osVersion = '10.10';
cb(null, "Mac OS X 10.10 is installed.");
} else if((stdout.match('10.11') !== null) || (stdout.match('10.11.1') !== null)) {
this.osVersion = '10.11';
cb(null, "Mac OS X 10.11 is installed.");
}else {
this.log.fail("Could not detect Mac OS X Version", cb);
}
} else {
this.log.fail("Unknown SW Version Command: " + err, cb);
}
}.bind(this));
};
但是只需要在/usr/local/lib/node_modules/appium/lib/doctor/ios.js改一下相应的配置就可以了。
IOSChecker.prototype.getMacOSXVersion = function (cb) {
exec("sw_vers -productVersion", function (err, stdout) {
if (err === null) {
if (stdout.match('10.8') !== null) {
this.osVersion = '10.8';
cb(null, "Mac OS X 10.8 is installed.");
} else if (stdout.match('10.9') !== null) {
this.osVersion = '10.9';
cb(null, "Mac OS X 10.9 is installed.");
} else if ((stdout.match('10.10') !== null) || (stdout.match('10.10.1') !== null)) {
this.osVersion = '10.10';
cb(null, "Mac OS X 10.10 is installed.");
} else if((stdout.match('10.11') !== null) || (stdout.match('10.11.1') !== null)) {
this.osVersion = '10.11';
cb(null, "Mac OS X 10.11 is installed.");
}else {
this.log.fail("Could not detect Mac OS X Version", cb);
}
} else {
this.log.fail("Unknown SW Version Command: " + err, cb);
}
}.bind(this));
};
相关文章推荐
- Appium自动化测试系列2- 写一个Python测试脚本来测试一下YY语音
- aptana导入python内置模块报错解决
- Linux下Appium环境搭建
- TestSuite很多skipped,报错Exception org.openqa.selenium.SessionNotCreatedException
- appium初入门android
- AppiumDriver driver = new AppiumDriver 的AppiumDriver报错问题解决
- WebDriverException: Message: A new 4000 session could not be created.
- Appium for windows环境搭建
- appium+testng报告更改
- appium那些坑
- Appium Python API 中文版
- 自动化测试实施策略(自动化测试经验分享)
- Appium环境的安装与配置_Python版
- Appium环境的安装与配置_Python版
- 自动化测试实施策略(自动化测试经验分享)
- Appium Python API 中文版
- appium那些坑
- warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future
- appium for windows 环境搭建
- Appium基于安卓的各种FindElement的控件定位方法实践和建议