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

折月煮酒 提交于 2019-12-03 09:28:48

问题


I'm trying to get an app running on the simulator that has had some problems doing so before. We don't have libjpeg.a built for i386, but it does have x86_64. This is the only dependency left, but I'm wondering why I actually need i386 symbols, if I'm running on an x86_64 mac.


回答1:


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.




回答2:


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



回答3:


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




回答4:


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)


来源:https://stackoverflow.com/questions/28033635/why-does-the-ios-simulator-require-i386-and-x86-64-symbols-even-though-im-on-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!