如何修复错误“无法从 sw_vers 输出检测 Mac OS X 版

How to fix error quot;Could not detect Mac OS X Version from sw_vers output: #39;10.12 #39;quot; from Appium(如何修复错误“无法从 sw_vers 输出检测 Mac OS X 版本:10.12来自Appium)

本文介绍了如何修复错误“无法从 sw_vers 输出检测 Mac OS X 版本:'10.12'"来自Appium的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 appium-1.5.3.dmg 但是当我点击听诊器按钮时,Appium 显示错误:

I installed appium-1.5.3.dmg But when I click the stethoscope button the Appium is show error :

 ✔ Xcode is installed at: /Library/Developer/CommandLineTools
[Error: Could not detect Mac OS X Version from sw_vers output: '10.12
']

谢谢!

推荐答案

它对我有用.

你可以通过这个命令配置文件:

You can config file by this command:

  • grep -rl "无法从 sw_vers 输出中检测到 Mac OS X 版本:"/Applications/Appium.app/

  • 终端会显示:/Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/build/lib/system.js/Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/lib/system.js/Applications/Appium.app//Contents/Resources/node_modules/appium-support/build/lib/system.js/Applications/Appium.app//Contents/Resources/node_modules/appium-support/lib/system.js

  • Terminal will show : /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/build/lib/system.js /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/lib/system.js /Applications/Appium.app//Contents/Resources/node_modules/appium-support/build/lib/system.js /Applications/Appium.app//Contents/Resources/node_modules/appium-support/lib/system.js

使用命令 vim 并配置每个文件.

Use command vim and config each file.

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

配置文件:

  1. 更改自 ->

  1. Change From ->

案例10:_arr = ['10.8', '10.9', '10.10', '10.11'];_i = 0;

到->

案例10:_arr = ['10.8', '10.9', '10.10', '10.11','10.12'];_i = 0;

<小时>

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

配置文件:

  1. 更改自 ->

  1. Change From ->

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

到 ->

试试{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;}}

到->

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

<小时>

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

配置文件:

  1. 更改自 ->

  1. Change From ->

案例10:_arr = ['10.8', '10.9', '10.10', '10.11'];_i = 0;

到->

案例10:_arr = ['10.8', '10.9', '10.10', '10.11','10.12'];_i = 0;

<小时>

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

配置文件:

  1. 更改自 ->

  1. Change From ->

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

到->

试试{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;}}

到->

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

点击启动听诊器按钮

这篇关于如何修复错误“无法从 sw_vers 输出检测 Mac OS X 版本:'10.12'"来自Appium的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何修复错误“无法从 sw_vers 输出检测 Mac OS X 版

基础教程推荐