Differences between compiling for i386 vs x86_64 in Xcode?

后端 未结 3 1707
时光说笑
时光说笑 2021-02-09 04:26

What are the differences between compiling a Mac app in Xcode with the Active Architecture set to i386 vs x86_64 (chosen in the drop down at the top left of the main window)? In

3条回答
  •  借酒劲吻你
    2021-02-09 05:05

    iOS apps need to run on many different architectures:

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

    Xcode basically emulates the environment of 32 bit or 64 bit based on what is set in the Valid Architecture - i386 or x86_64 respectively

    Every architecture requires a different binary, and when you build an app Xcode will build the correct architecture for whatever you’re currently working with. For instance, if you’ve asked it to run in the simulator, then it’ll only build the i386 version (or x86_64 for 64-bit).

提交回复
热议问题