即使Xcode在M1上成功进行模拟器,XcodeBuild也会失败

发布于 2025-02-13 06:18:44 字数 523 浏览 0 评论 0原文

我有一个项目,该项目仅在我的M1上与Rosetta建立。如果我在XCode中打开项目并为模拟器构建,则可以使用该项目,但是如果我从命令行构建,则失败了错误:

❌  ld: in /root/Realm/core/librealmcore-ios.a(bptree.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

当不使用Rosetta时,我还将在Xcode中获得此错误。当我用Rosetta运行Xcode时,错误会消失。

如何与Rosetta一起运行Xcodebuild?

这是我目前正在使用的命令:

xcodebuild build -workspace "MyWorkspace.xcworkspace" -scheme "MyApp" \
    -destination "generic/platform=iOS Simulator"

I have a project which is only building in Xcode with Rosetta on my M1. If I open the project in Xcode and build for the simulator it works, but if I build from command line it fails with the error:

❌  ld: in /root/Realm/core/librealmcore-ios.a(bptree.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

I will also get this error in Xcode when not using Rosetta. When I run Xcode with Rosetta then the error goes away.

How do I run xcodebuild with Rosetta?

Here's the command I am currently using:

xcodebuild build -workspace "MyWorkspace.xcworkspace" -scheme "MyApp" \
    -destination "generic/platform=iOS Simulator"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文