Appium Doctor iOS Could not detect Mac OS X Version from sw_vers output: '10.12 '解决方法

来源:互联网 发布:c语言fabs函数确定精读 编辑:程序博客网 时间:2024/05/21 08:53

Appium Doctor  iOS Could not detect Mac OS X Version from sw_vers output: '10.12.3 '   解决方法

     本人亲测验证,本人Mac 系统为10.12.3 ,Appium版本为:appium-1.5.3.dmg

4 步骤解决问题:

步骤一、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/build/lib/system.js
修改:
case 10:
    _arr = ['10.8', '10.9', '10.10', '10.11'];
    _i = 0;
改为:
case 10:
    _arr = ['10.8', '10.9', '10.10', '10.11','10.12.3'];
    _i = 0;
步骤二、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/lib/system.js
(1)修改:
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
改为:
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout.trim();
}
(2)修改:
for (let v of ['10.8', '10.9', '10.10', '10.11']) {
if (stdout.indexOf(v) === 0) { return v; }
}
改为:
for (let v of ['10.8', '10.9', '10.10', '10.11','10.12.3']) {
if (stdout.indexOf(v) === 0) { return v; }
}
步骤三、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium-support/build/lib/system.js
修改:
case 10:
    _arr = ['10.8', '10.9', '10.10', '10.11'];
    _i = 0;
改为:
case 10:
    _arr = ['10.8', '10.9', '10.10', '10.11','10.12.3'];
    _i = 0;
步骤四、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium-support/lib/system.js
(1)修改:
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
改为:
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout.trim();
}
(2)修改:
for (let v of ['10.8', '10.9', '10.10', '10.11']) {
if (stdout.indexOf(v) === 0) { return v; }
}
改为:
for (let v of ['10.8', '10.9', '10.10', '10.11','10.12.3']) {
if (stdout.indexOf(v) === 0) { return v; }
}


参考文章:http://stackoverflow.com/questions/40129794/how-to-fix-error-could-not-detect-mac-os-x-version-from-sw-vers-output-10-12

0 0
原创粉丝点击