如何修复错误“无法从sw_vers输出检测到Mac OS X版本:"10.12"".来自Appium [英] How to fix error "Could not detect Mac OS X Version from sw_vers output: '10.12 '" from 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//内容/资源/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
配置文件:
-
从->
Change From ->
case 10:
_arr = ['10.8', '10.9', '10.10', '10.11'];
_i = 0;
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'];
_i = 0;
case 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
配置文件:
-
从->
Change From ->
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
收件人->
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout.trim();
}
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; }
}
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; }
}
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
配置文件:
-
从->
Change From ->
case 10:
_arr = ['10.8', '10.9', '10.10', '10.11'];
_i = 0;
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'];
_i = 0;
case 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
配置文件:
-
从->
Change From ->
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout;
}
至->
try {
stdout = (await exec('sw_vers', ['-productVersion'])).stdout.trim();
}
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; }
}
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; }
}
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!