Appium Doctor iOS Could not detect Mac OS X Version from sw_vers output: '10.12.3 ' 解决方法
本人亲测验证,本人Mac 系统为10.12.3 ,Appium版本为:appium-1.5.3.dmg
4 步骤解决问题:
步骤一、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/build/lib/system.js
修改:
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.3'];
_i = 0;
步骤二、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium/node_modules/appium-support/lib/system.js
(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.3']) {
if (stdout.indexOf(v) === 0) { return v; }
}
步骤三、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium-support/build/lib/system.js
修改:
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.3'];
_i = 0;
步骤四、
vi /Applications/Appium.app//Contents/Resources/node_modules/appium-support/lib/system.js
(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.3']) {
if (stdout.indexOf(v) === 0) { return v; }
}