即使Xcode在M1上成功进行模拟器,XcodeBuild也会失败
我有一个项目,该项目仅在我的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论