zoukankan      html  css  js  c++  java
  • mac下执行 appium-doctor 出现 “Could not detect Mac OS X Version from sw_vers output: '10.12 '” 解决方法

     

     

    You can config file by this command:

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

    enter image description here

    • 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

    • Use command vim and config each file.

    Example

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

    enter image description here

    Config file:

    enter image description here

    1. Change From ->

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

      To ->

      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
    

    enter image description here

    Config file:

    enter image description here

    1. Change From ->

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

      To -> 

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

    2. Change From ->

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

      To ->

      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
    

    enter image description here

    Config file:

    enter image description here

    1. Change From ->

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

      To ->

      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
    

    enter image description here

    Config file:

    enter image description here

    1. Change From ->

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

      To ->

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

    2. Change From ->

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

      To ->

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

    Click start the stethoscope button

    enter image description here

  • 相关阅读:
    如何检查项目的需求是否完整
    Linux环境 Java内存快速查看
    字符串拼接性能比较出乎意料的结果
    MySQL 查看表大小
    五大机器学习微信公众号推荐
    如何用PYTHON代码写出音乐
    【转载】机器学习如门概览
    机器学习PAI为你自动写歌词,妈妈再也不用担心我的freestyle了(提供数据、代码)
    【转载】程序猿转型AI必须知道的几件事!
    如何拿到阿里算法校招offer
  • 原文地址:https://www.cnblogs.com/kaibindirver/p/8639356.html
Copyright © 2011-2022 走看看