You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Appium iOS自动化报错:无法启动WebDriverAgent,xcodebuild返回码65

解决Appium启动WebDriverAgent报错xCodebuild failed with code 65的方案
  • 先搞定Xcode签名和项目配置
    找到Appium安装目录下的WebDriverAgent项目(路径一般是node_modules/appium-xcuitest-driver/WebDriverAgent),用Xcode打开WebDriverAgent.xcodeproj。分别给WebDriverAgentRunner和WebDriverAgentLib两个target设置正确的开发者Team,确保签名没有红色报错。直接在Xcode里把WebDriverAgentRunner运行到测试设备上,能跑通的话就排除了签名和Xcode基础问题。

  • 检查设备端权限
    测试设备上必须信任你的开发者账号:进「设置」>「通用」>「VPN与设备管理」,找到对应的开发者账号点信任。另外确认设备USB连接正常,Xcode的「Window」>「Devices and Simulators」里能看到设备状态是已连接。

  • 排查端口和版本兼容问题
    用lsof -i :8100命令检查8100端口是否被其他进程占用,要是有就杀掉对应进程。同时确认Appium版本和WebDriverAgent版本匹配,建议升级到Appium最新稳定版,或者手动同步WebDriverAgent的兼容版本。

  • 用命令行定位具体错误
    直接跑xcodebuild命令看详细报错,比如:

    xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=你的设备UDID' test
    

    执行后会输出具体的失败原因,比如证书过期、设备系统版本不支持、权限不够之类的,照着提示修就行。

  • 重置WebDriverAgent的编译缓存
    要是之前改过配置出问题,就删掉WebDriverAgent的DerivedData(Xcode偏好设置>位置>DerivedData里找到对应项目删除),然后重新配置签名再编译。

WebDriverAgent启动报错截图

内容的提问来源于stack exchange,提问作者Automation Tester

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 02:14:59