Architectures are the ones you want to build, valid architectures are the ones you could conceive of building with your codebase.
So maybe you only want to build your binary for armv7s, but the same source code would compile fine for armv7 and armv6. So VALID_ARCHS = armv6 armv7 armv7s, but you set ARCHS = armv7sbecause that's all you actually wantto build with your code.
Or, in Apple-ese:
ARCHS (Architectures)
Space-separated list of identifiers. Specifies the architectures (ABIs, processor models) to which the binary is targeted. When this build setting specifies more than one architecture, the generated binary may contain object code for each of the specified architectures.
and:
VALID_ARCHS (Valid Architectures)
Space-separated list of identifiers. Specifies the architectures for which the binary may be built. During the build, this list is intersected with the value of ARCHS build setting; the resulting list specifies the architectures the binary can run on. If the resulting architecture list is empty, the target generates no binary.
Source: Xcode Build Setting Reference
In practice, you leave VALID_ARCHSalone and don't worry about changing it, and just fiddle with ARCHSto set the architectures you want to build. Typically, you set a Debug build to just NATIVE_ARCH, since you only want to build the debug version for the machine you'll be testing/running it on, and Release builds for the full spectrum of architectures you plan to support.
原文连接:http://hi.baidu.com/ztdj121/item/51923fe56d7afdfce0a5d4c1