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