Why does the iOS simulator require i386 and x86_64 symbols even though I'm on an x86_64 system only?

二次信任 提交于 2019-12-03 00:12:21

The iOS simulator can run your app in 32 and 64-bit modes. This is allows you to work out a lot of 64-bit issues and make sure it is ready for both armv7 and arm64. To do this, it compiles your app for i386 and x86_64 and requires the libraries for both architectures.

iOS apps need to run on many different architectures:

arm7: Used in the oldest iOS 7-supporting devices
arm7s: As used in iPhone 5 and 5C
arm64: For the 64-bit ARM processor in iPhone 5S
i386: For the 32-bit simulator
x86_64: Used in 64-bit simulator

actually i386 architecture is for iPhone simulator where as x86_64 architecture is for iPad simulators, both are 32 and 64bit compatible.

While these days I have tried to run Fastlane to get iOS screen capture, I found the same situation:Because there is .a library contains only x86_64 architecture,but without i386 architecture,and then I got this error:

Undefined symbol(s) for architecture i386

This is running on iPhone 8 simulator with iOS 11.4.

But you can force the simulator to run on only 64-bit or only 32-bit as follows:

Project -> Architectures -> set the value as:$(ARCHS_STANDARD_32_BIT) or $(ARCHS_STANDARD_64_BIT)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!