【Appium踩坑】xcodebuild: Unable to find a destination matching the provided destination specifier

问题现象:

1、WebdriverAgent 在 Xcode + 真机上 test 正常
2、开启 appium server 后,UI 脚本启动后提示:

[W3C][39m Encountered internal error running command:
 Error: Unable to launch WebDriverAgent because of xcodebuild failure: 
 xcodebuild failed with code 70
解决:
1、先查一下 xcodebuild failed with code 70

解决思路都是:
(1)在 Xcode 上启动WebdriverAgent,再执行
(2)升级 appium
但我本地已经是最新appium 并在真机上testing了。
应该不是一样的问题,可能有其他问题,继续查看日志。

日志里有一行:

2021-06-25 07:58:19:379 [WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. 
To change this, use 'showXcodeLog' desired capability
2、尝试增加caps “showXcodeLog”,查看详细Xcode 日志
caps['showXcodeLog']=True

继续执行 UI 脚本,出现新的报错信息了!

[W3C] Command line invocation:
      ...
[W3C] xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[W3C] 		{
   
    id:00008222-001E11D90C32223A }
[W3C] 	The requested device could not be found because no available devices matched the request.
[W3C] 	Available destinations for the "WebDriv
在使用 `pip install appium` 命令安装 Appium 时出现 `Could not find a version that satisfies the requirement appium (from versions: none)` 和 `No matching distribution found for appium` 错误,通常是由于 PyPI(Python Package Index)上没有合适的 Appium 版本,或者网络问题导致无法获取正确的版本信息。以下是一些可能的解决办法: #### 1. 检查 Python 版本兼容性 确保使用的 Python 版本与 Appium Python 客户端兼容。Appium Python 客户端可能对 Python 版本有特定要求,不兼容的 Python 版本可能导致找不到匹配的包版本。可以使用以下命令查看 Python 版本: ```bash python --version ``` 如果版本不兼容,考虑升级或降级 Python 版本。 #### 2. 更新 pip 和 setuptools 确保使用的是最新版本的 `pip` 和 `setuptools`,旧版本的 `pip` 可能无法正确解析包的版本信息。可以使用以下命令进行更新: ```bash pip install --upgrade pip setuptools ``` #### 3. 使用不同的镜像源 有时候,默认的 PyPI 镜像源可能无法正常访问或更新不及时,导致找不到匹配的包版本。可以尝试使用国内的镜像源,例如阿里云、清华大学等。以下是使用阿里云镜像源安装 Appium 的示例: ```bash pip install appium -i https://mirrors.aliyun.com/pypi/simple/ ``` #### 4. 手动指定版本 如果知道 Appium Python 客户端的特定版本,可以尝试手动指定版本进行安装。例如: ```bash pip install appium==<版本号> ``` 将 `<版本号>` 替换为具体的版本号,如 `2.0.0`。 #### 5. 检查网络连接 确保网络连接正常,能够访问 PyPI 或使用的镜像源。可以尝试使用浏览器访问镜像源地址,检查是否能够正常打开。 #### 6. 检查包名 确认要安装的包名是正确的。Appium Python 客户端的包名通常是 `Appium-Python-Client`,而不是 `appium`。可以使用以下命令安装: ```bash pip install Appium-Python-Client ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值