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

【已解决】osx下运行appium doctor提示[Error: Could not detect Mac OS X Version from sw_vers output: '10.13.2 ']

2018-01-16 14:45 465 查看
osx 10.13.2  appium-desktop1.5.3

解决方法:

1.在终端中输入 grep -rl  “Could not detect Mac OS X Version from sw_vers output:”/Applications/Appium.app

以上会返回四个文件路径

a:/Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/build/lib/system.js

b:/Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/lib/system.js

c:/Applications/Appium.app//Contents/Resources/node_modules/appium-support/build/lib/system.js

d:/Applications/Appium.app//Contents/Resources/node_modules/appium-support/lib/system.js

2.分别打开四个文件:

其中a、b中查找到case10一行,添加上当前的osx版本

修改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.13’]; _i = 0; 

cd中找到try一行,修改

try { stdout = (await exec('sw_vers', ['-productVersion'])).stdout; }->try { stdout = (await exec('sw_vers', ['-productVersion'])).stdout.trim(); }

再找到for (let v of ['10.8', '10.9', '10.10', '10.11']) { if (stdout.indexOf(v) === 0) { return v; } }添加上osx的版本

->for (let v of ['10.8', '10.9', '10.10', '10.11','10.13’]) { if (stdout.indexOf(v) === 0) { return v; } }

vim后输入键盘I 直接修改文件即可

最后保存命令为  wq!

重新运行检查命令,发现检查通过,--done

参考原文章:http://www.linkedin.com/pulse/how-fix-error-could-detect-mac-os-x-version-from-swvers-soontaku
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐