Xcode 15下Bazel iOS测试失败问题排查求助
Xcode 15 下 Bazel iOS 测试报错问题排查
问题背景
- 测试环境:Xcode 15,运行 Bazel iOS 测试
- 异常现象:该测试在 Xcode 14.3.1 中可正常通过,但在 Xcode 15 中触发如下错误:
xcodebuild: error: Failed to build workspace temporary with scheme Transient Testing.: File is of an unsupported type; must be either an xctestrun file or xctestproducts bundle.
问题分析与结论
是的,xctestrun.py 生成的文件命名为 xctestrun.plist、缺少标准 .xctestrun 后缀,很大概率就是导致该报错的原因
原因如下:
- Xcode 15 对测试运行文件的后缀校验规则比 Xcode 14.3.1 更严格
- Xcode 15 版本的
xcodebuild会强制校验文件类型,仅识别后缀为.xctestrun的文件或 xctestproducts bundle 作为合法的测试运行载体,而 Xcode 14.3.1 对后缀的限制相对宽松,允许.plist后缀的同名文件通过校验
解决方案
修改 xctestrun.py 的生成逻辑,将输出文件命名为带有 .xctestrun 后缀的格式(例如 YourTestTarget.xctestrun),替换原有的 xctestrun.plist 命名方式。
内容的提问来源于stack exchange,提问作者Steven Hepting
相关产品推荐
相关产品推荐

