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

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值