Overview of Architecture in Xcode Build settings

Source: Internet
Author: User

Xcode 6.1 Version When you create a new project, you will give us some default build Settings, one of which is important is the architecture setting, first look at a picture, as follows:


In the second row of architectures, the standard schema is set, which includes the ARMV7, Arm64. This compilation option specifies which instruction sets the project will be compiled to support, which is implemented by compiling the corresponding binary packets, and if more than one number of instruction sets are supported, the packets containing multiple instruction set codes are compiled, resulting in a large package that is eventually compiled.

The bottom line in blue shows the valid architectures this list specifies the intersection of the supported instruction set and the instruction set in architectures, which will be the set of instructions supported by Xcode's resulting binary package.

The instruction set intersection of the above results is arm64 and armv7, so the set of instructions that the final binary package can support is both.

There is also a build Active Architecture only here is a bool value. This compilation is used to set whether to compile the arm instruction set corresponding to the device currently in use. For example, when you are debugging the device is IPhone5, then the compilation will be generated by the IPHONE5 supported arm instruction set, That is arm64. If you have Xcode successfully connected to the device and this value is set to Yes, if you are not connected to the device, then even if the value is set to Yes, the generated binary supports the arm instruction set, or the intersection between the two. Normally you can set the Yes,release version to No when the debug version is available. Because the release version is for publishing, the compiler will do some optimizations for my door. The debug version is usually used for testing. It is necessary to follow the arm instruction set of the device.

Note: The instruction set is backwards compatible. For example, if your device is a armv7s instruction set, it can also be run with a lower instruction set than the armv7s version: Armv7,armv64, and so on.

Take a look at the arm instruction set for each device (1G for generation, 2G for second generation):

Armv6:iphone 2g/3g, IPod 1g/2g

Armv7:iphone 3gs/4/4s, IPod 3g/4g,ipad 1g/2g/3g,ipad Mini 1

Armv7s:iphone5, Iphone5c,ipad4

Armv8/arm64:iphone 5s,ipad5 IPad Mini 2

The IOS7 package, previously compiled by Xcode 5, contains both 32-bit and 64-bit binary code, 32-bit binary code is called on 32-bit iOS systems, and 64-bit binary code is called on 64-bit systems to resolve backward compatibility issues. So the 32-bit app can run on a 64-bit OS without recompiling, the answer is yes, in 64-bit OS, the system has two sets of Farmework, one set is 32 bits, and the other is 64-bit. When the 64-bit system runs the original 32 app, it calls the 32 framework as the underlying support.

When I was a company project, I used a third party social sharing static library it does not support 64-bit architecture, found that if added, will compile failure, first look at:



See, it ignores that static library file causes the link to fail, then I look at the schema supported by the static library, open the Terminal input View command Lipo-info XXX.A, the result is as follows:


This static library is found to support only armv7 armv7s i386. And in my project valid architectures and architectures contain arm64 instruction sets, This is to show that I need to compile the app eventually to support Arm64, and the application of the static library is not arm64, so it caused the error, so in valid Architectures to remove the arm64, then you can compile and pass the normal.

Overview of Architecture in Xcode Build settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.