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

iOS自动化执行失败:Robot Framework+Appium报xcodebuild错误70

解决iOS自动化测试中xcodebuild错误代码70的方案

以下是针对该错误的针对性排查和解决步骤:

1. 重新配置WebDriverAgent签名

  • 定位到xcuitest驱动的WebDriverAgent项目路径,通常为~/.appium/node_modules/appium-xcuitest-driver/WebDriverAgent
  • 用Xcode打开WebDriverAgent.xcodeproj,分别为WebDriverAgentLib和WebDriverAgentRunner两个target配置匹配的开发者证书与Provisioning Profile,确保证书包含测试设备的UDID
  • 手动编译运行WebDriverAgentRunner到目标设备,确认无签名类报错,能正常启动

2. 清理设备残留应用

  • 在iOS设备上删除所有含WebDriverAgent或Runner字样的应用
  • 重启设备,彻底清除缓存残留

3. 对齐Xcode命令行工具版本

  • 执行命令确认当前命令行工具路径:
    xcode-select -p
    
  • 若输出路径未指向Xcode 15.0.1,执行切换命令:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

4. 调整Appium测试能力参数

在Robot Framework的测试配置中添加以下关键参数,确保签名配置正确:

*** Test Cases ***
Init iOS Test
    Open Application    appium_url=http://localhost:4723/wd/hub
    ...    platformName=iOS    platformVersion=17.0    deviceName=你的设备名称
    ...    app=/本地应用路径/your_app.ipa
    ...    xcodeOrgId=你的开发者团队ID    xcodeSigningId=iPhone Developer
    ...    updatedWDABundleId=com.你的公司域名.WebDriverAgentRunner

注:updatedWDABundleId需设置为你已在Provisioning Profile中注册的自定义Bundle ID

5. 调整xcuitest驱动版本

当前xcuitest@5.7.0与Xcode 15.0.1可能存在兼容性问题,尝试切换版本:

  • 卸载当前驱动:
    appium driver uninstall xcuitest
    
  • 安装兼容版本(如5.6.0):
    appium driver install xcuitest@5.6.0
    

6. 检查MacOS系统权限

  • 打开「系统设置」→「隐私与安全性」→「完全磁盘访问」,确保Xcode、终端(或你运行Appium的工具)已获得权限
  • 检查「自动化」权限,允许相关进程控制Xcode

内容的提问来源于stack exchange,提问作者Nidit Mehta

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.06 19:30:28