您的位置:首页 > 移动开发

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));
};

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  appium