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
相关产品推荐
相关产品推荐

