找出哪些文件會報該錯誤內容:
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
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
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
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
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; }
}