Appium之Doctor报错:iOS Could not detect Mac OS X Version from sw_vers output: '10.12.5 '的解决方法

来源:互联网 发布:网络优化培训班 编辑:程序博客网 时间:2024/05/21 14:47

背景

       亲测验证
       Mac 系统为10.12.5
       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.5'];    _i = 0;

       注意退出时,:wq 退出并保存。

步骤二、

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.5']) {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.5];    _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.5']) {if (stdout.indexOf(v) === 0) { return v; }}
阅读全文
1 0