赞
踩
踩坑搞了我2天多终于找到解决办法了
先看报错信息
[debug] [W3C] Encountered internal error running command: Error: Failed to receive any data within the timeout: 5000
[debug] [W3C] at Timeout._onTimeout (/opt/homebrew/lib/node_modules/appium/node_modules/appium-ios-device/lib/plist-service/index.js:67:16)
[debug] [W3C] at listOnTimeout (node:internal/timers:573:17)
[debug] [W3C] at processTimers (node:internal/timers:514:7)
[HTTP] <-- POST /wd/hub/session 500 10431 ms - 605
iPhone手机真机明明和电脑连接正常用客户端版appium也正常到终端就报错内部超时连不上设备
解决办法(最好看完根据个人情况来改)
node(npm,cnpm)和appium(包括appium-doctor)最好都安装在homebrew(下载方式网上搜一大堆)路径(/opt/homebrew/lib/node_modules )
,其次下载完的appium记得替换appium-webdriveagent里面内容文件(网上搜github下载webdriveagent文件替换),最后node版本要选低版本的不能选高版本的比如14
1、卸载node指令(local路径生效)
sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm /usr/local/bin/node
然后node -v查看情况,如果还有就用brew uninstall node卸载
然后安装node用brew insatall node@14
安装完成node -v没显示版本号就open ~/.zshrc
输入export PATH=“/opt/homebrew/opt/node@14/bin:$PATH”
保存退出source ~/.zshrc
再node-v 就正常了
npm install -g appium@1.20.2 下载完成后记得替换webdriveragent文件
npm install -g appium-doctor
npm uninstall -g appium (卸载appium)
总结,appium版本可以高点但node最好版本低点,指令最好安装homebrew里不要安装本地路径local
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。