zoukankan      html  css  js  c++  java
  • Appium:“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

  • 相关阅读:
    mysql主从部署
    解决mysql登录警告问题
    使用selenium控制已打开的浏览器
    jTopo生成网络拓扑图
    Python模拟登陆正方教务系统并抓取成绩单
    Pandas库学习笔记
    三种方法实现统计一个句子中的字母数 (setdefault、defaultdict的使用)
    numpy学习笔记
    字符串的模式匹配——Brute-Force算法和KMP算法
    用生成器来改写直接返回列表的函数
  • 原文地址:https://www.cnblogs.com/nemolmt/p/6667627.html
Copyright © 2011-2022 走看看