Appium iOS自动化

问题描述:

  • 环境:Mac 11.3 Beta版
  • 问题复述:使用appium做iOS UI自动化时,在webdriveragent官网下载了工程文件,运行./Scripts/bootstrap.sh命令报错。

相关log文件

# npm resolution error report

2021-09-01T14:57:39.973Z

While resolving: web-driver-inspector@1.0.0
Found: webpack@1.15.0
node_modules/webpack
  webpack@"^1.12.0" from the root project

Could not resolve dependency:
peer webpack@"^4.0.0 || ^5.0.0" from webpack-dev-server@3.11.2
node_modules/webpack-dev-server
  dev webpack-dev-server@"^3.1.14" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "webpack",
    "version": "1.15.0",
    "whileInstalling": {
      "name": "web-driver-inspector",
      "version": "1.0.0",
      "path": "/Users/lilycao/Downloads/WebDriverAgent-master 2/Inspector"
    },
    "location": "node_modules/webpack",
    "dependents": [
      {
        "type": "prod",
        "name": "webpack",
        "spec": "^1.12.0",
        "from": {
          "location": "/Users/lilycao/Downloads/WebDriverAgent-master 2/Inspector"
        }
      }
    ]
  },
  "currentEdge": {
    "type": "prod",
    "name": "webpack",
    "spec": "^1.12.0",
    "from": {
      "location": "/Users/lilycao/Downloads/WebDriverAgent-master 2/Inspector"
    }
  },
  "edge": {
    "type": "peer",
    "name": "webpack",
    "spec": "^4.0.0 || ^5.0.0",
    "error": "INVALID",
    "from": {
      "name": "webpack-dev-server",
      "version": "3.11.2",
      "whileInstalling": {
        "name": "web-driver-inspector",
        "version": "1.0.0",
        "path": "/Users/lilycao/Downloads/WebDriverAgent-master 2/Inspector"
      },
      "location": "node_modules/webpack-dev-server",
      "dependents": [
        {
          "type": "dev",
          "name": "webpack-dev-server",
          "spec": "^3.1.14",
          "from": {
            "location": "/Users/lilycao/Downloads/WebDriverAgent-master 2/Inspector"
          }
        }
      ]
    }
  },
  "peerConflict": null,
  "strictPeerDeps": false,
  "force": false
}

另外,尝试过使用appium自带的webdriveragent文件运行./Scripts/bootstrap.sh命令也报错

去github上下载呢

appium-webdriveragent.zip (3.0 MB)

/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent

/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

这两个文件替换掉这个压缩文件,然后再sh ./Scripts/bootstrap.sh
image
命令行显示这样就正常了

多谢,问题解决了 :heart:

关闭