The difference between Xcode's architectures and valid architectures,

Source: Internet
Author: User

Login | Registered

ys410900345 's Column

catalog view Summary View subscriptions

The Academy app downloads for the first time and can get 50C coins! Welcome to help Open source "Progress" as a lecturer? Love to learn? Vote for the class. CSDN 2015 Blog Star selection results announced

Shut down

The difference between Xcode's architectures and valid architectures,

2014-05-14 11:23 651 People read review (0) Favorite Report

Category: iOS development (70)

Directory (?) [+]

Posted 6 months ago (2013-10-29 21:07) Read (1085) | Comments (1) 2 people collection This article, I want to collect

Likes 1

Architectures Valid architectures including 64-bit armv7 arm64

Catalogue [-]

The difference between Xcode's architectures and valid architectures

Architectures

Valid architectures

The reasons are explained as follows:

Reference 1:

All iOS device details list of iOS devices-wikipedia, the free encyclopedia

Reference 2:

IOS 7: How to compile 64-bit apps for iphone 5S.

Reference 3:

What's the difference between "architectures" and "Valid architectures" in Xcode Build Settings?

Reference 4:

Xcode 5 and IOS 7:architecture and Valid architectures

Reference 5:

How to the Stop xcode5.1 building for 64bit

Reference 6:

1. Xcode Build Setting Reference (Apple Official document)

2.64-bit Transition Guide for Cocoa Touch (Apple official documentation)

shede333

Home: http://my.oschina.net/shede333

Copyright Notice: Original article, copyright notice: Free Reprint-Non-commercial-non-derivative-maintain attribution | Creative Commons by-nc-nd 3.0

The difference between Xcode's architectures and valid architectures

Architectures

This represents the list of target devices that you want Xcode to compile in this project.

Valid architectures

It's not too clear the intent of this setting, but generally there is no need to change it.

In the valid architectures setting in Xcode5.0, there are 2 options:

The default is standard architectures (including 64-bit) (armv7,armv7s,arm64), so that your deployment target can only be set to 6.0, (after Xcode5.0.1 , with the lowest compatible with iOS 5.1.1);

Standard architectures (armv7,armv7s), this setting, your deployment target minimum can be set to 4.3;

The reasons are explained as follows:

Using the standard architectures (including 64-bit) (armv7,armv7s,arm64) parameter,

There are 32-bit, 64-digit, two-part codes in the package.

Under IPhone5S (the CPU of IPHONE5S is 64 bits), it is preferred to run 64-bit code package,

The rest of the iphone (the remaining iphone is 32-bit, IPHONE5C is also 32-bit),

Only 32-bit packages can be run.

However, a code package that contains two schemas is only run on the IOS6,IOS7 system.

That is to say, this packing way, to the mobile phone almost no requirements, but the system has requirements, that is IOS6 above.

Using the standard architectures (armv7,armv7s) parameter,

The only 32-bit code in the bag,

The IPHONE5S CPU is 64 bits, but it is compatible with 32-bit code, which can run 32-bit code. However, this can degrade the performance of iphone5s, for the following references are explained.

The rest of the iphone is no problem with 32-bit code packages,

The 32-bit code pack also has almost no limitations on the system.

So the summary is as follows:

To play the IPhone5S 64-bit performance, the 64-bit package is included, then the system minimum requirement is IOS6.

If you want to be compatible with IOS5 and lower systems, you can only hit 32-bit packages, the system can be universal, but will lose the performance of iphone5s.

Reference 1:

All iOS device details list of iOS devices-wikipedia, the free encyclopedia

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:iphone5s, IPAD5 (ipad Air), ipad mini 2 (ipad mini Retina)

Reference 2:

IOS 7: How to compile 64-bit apps for iphone 5S.

Xcode 5 compiled iOS 7 programs contain 32-bit and 64-bit binaries, 32-bit binary code is called on 32-bit iOS systems, and 64-bit binary code is called on 64-bit systems to resolve backwards compatibility issues.

At the same time, considering that many 32-bit programs may be deployed to 64-bit systems without recompiling, 64-bit iOS systems have two sets of frameworks, one set of 32-bit and 64-bit.

When the 64-bit iOS system runs the original 32-bit program, the system calls the 32-bit framework as the underlying support, and when the system runs a 64-bit program, the system calls the 64-bit framework as the underlying support.

In other words, when running 32-bit programs and 64-bit programs on an iphone 5S, the system loads both 32-bit and 64-bit frameworks into memory, so it consumes more memory.

If all the programs running on a 64-bit iOS device are compiled for a 64-bit system, the iOS system will only load the 64-bit framework, which will save a lot of memory. So, if everyone can quickly convert the program to 64-bit, iOS will run faster. Really is "everybody is good is really good".

Reference 3:

What's the difference between "architectures" and "Valid architectures" in Xcode Build Settings?

Architectures is the ones you want to build, valid architectures is the ones you could conceive of building with your co Debase.

So maybe is 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 = Armv7s because that's all you actually want to build with your co De.

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 builds setting specifies more than one architecture, the generated binary could 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 is built. During the build, this list was 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, leave valid_archs alone and don ' t worry about changing it, and just fiddle Witharchs to set the architect Ures 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 ' l L be testing/running it on, and Release builds for the full spectrum of architectures you plan to support.

Reference 4:

Xcode 5 and IOS 7:architecture and Valid architectures

Set the architecture in build setting to standard architectures (armv7,armv7s)

Enter image description here

IPhone 5S is powered by A7 64bit processor. From Apple Docs

Xcode can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of IOS 7 or later.

NOTE:A future version of Xcode would let you create A single app this supports the 32-bit runtime on IOS 6 and later, and That's supports the 64-bit runtime on IOS 7.

From the documentation what I understood is

Xcode can create both 64bit 32bit binaries for a single app but the

Deployment target should be iOS7. They is saying in the future it'll

Be IOS 6.0

The "binary would work" fine in IPhone 5S (processor).

Update (Xcode 5.0.1)

In Xcode 5.0.1 They added the "support" to create the $ binary for IOS 5.1.1 onwards.

Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of IOS 5.1.1 or later. The 64-bit binary runs only on 64-bit devices running IOS 7.0.3 and later.

Update (Xcode 5.1)

Xcode 5.1 made significant change on the architecture section. This answer is a followup for you.

Check this

Reference 5:

How to the Stop xcode5.1 building for 64bit

OP is posted the solution along with the question itself. But I feel it would is better to add it as an answer. In Xcode 5.1 Apple made significant changes to the architecture section. They made arm64 as part of the standard architectures. That means the projects using the default setting would be is automatically build for arm64 also. So what would do if your app does not arm64?.

Doc says:

Projects not able to support 64-bit need to specifically set the architectures build setting to not include 64-bit.

How does that?

Goto Targets–>build Settings–>architectures–>architectures

Double Click on the Architecture would popup a menu. Choose others

Enter image description here

Delete the existing row-$ (arch_standard). ADD the required architectures one by one

Enter image description here

Now your architecture section would look like this

Enter image description here

Cgrectinset Cgrectoffset uiedgeinsetsinsetrect Usage of these three functions (1)

Some experience sharing about Uisearchdisplaycontroller (1)

The difference between Xcode's architectures and valid architectures,

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.