Could not detect Mac OS X Version from sw_vers output: '10.12 '

找出哪些文件会报该错误内容:

grep -rl "Could not detect Mac OS X Version from sw_vers output:" /Applications/Appium.app/

Termina显示如下图,使用vim命令对这些文件进行修改:


修改说明:

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

Could not detect Mac OS X Version from sw_vers output: '10.12 '_第1张图片

1.修改:

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;



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

Could not detect Mac OS X Version from sw_vers output: '10.12 '_第2张图片

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']) {

if (stdout.indexOf(v) === 0) { return v; }

}


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


Could not detect Mac OS X Version from sw_vers output: '10.12 '_第3张图片

1.修改:

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;


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


Could not detect Mac OS X Version from sw_vers output: '10.12 '_第4张图片

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']) {

if (stdout.indexOf(v) === 0) { return v; }

}


完毕!

你可能感兴趣的:(Could not detect Mac OS X Version from sw_vers output: '10.12 ')