XCUITests 在 m1 Mac 上失败:mach-o,但架构错误

时间:2021-07-07 18:47:10

标签: ios xcode xctest apple-m1 xcuitest

我的应用中有一个完美运行的 UITest 目标,它在基于 Intel 的旧 Mac 上运行良好。

如果我在 M1 Mac 中提取相同的代码,UITests 甚至在执行之前就会失败。

应用在测试运行时启动,但结果是“测试失败”,调试器说:

“MirageUITests” couldn’t be loaded because it doesn’t contain a version for the current architecture. Try installing a universal version of the bundle.
2021-07-08 00:04:33.819224+0530 MirageUITests-Runner[59250:3764976] (dlopen_preflight(/Users/jake/Library/Developer/Xcode/DerivedData/Mirage-bjcrubavwaoeufgtdntitbgnmgae/Build/Products/Debug-iphonesimulator/MirageUITests-Runner.app/PlugIns/MirageUITests.xctest/MirageUITests): no suitable image found.  Did find:
    /Users/jake/Library/Developer/Xcode/DerivedData/Mirage-bjcrubavwaoeufgtdntitbgnmgae/Build/Products/Debug-iphonesimulator/MirageUITests-Runner.app/PlugIns/MirageUITests.xctest/MirageUITests: mach-o, but wrong architecture)

这个 UITest 目标似乎只有 mach-o arch。这还不够。它还说,尝试安装捆绑包的通用版本,但这是 XCFramework,其中 1 个捆绑包可以同时包含两个 sim。和设备拱门。这怎么可能仅适用于模拟器用例?

0 个答案:

没有答案