Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 and iOS 7: Architecture and Valid architectures

I'm starting new project in Xcode 5. I want to develop application using iOS SDK 7 but with deployment target iOS 5.0. As soon as I create new project in Xcode and try to change deployment target to 5.0, I've got this message:

Applications including an arm64 slice are not compatible with versions of iOS prior to 6.0 Adjust your Architectures build setting to not include arm64 in order to deploy to releases prior to iOS 6.0. 

So changed architectures to Standard (no 64bit). I compiles, runs but I do not really understand what just happend.

What's the difference between Architectures and Valid architectures settings in Xcode project Build Settings?
If I set Architectures to exclude 64-bit what happens when I run my app on 64-bit iPhone or iOS Simulator (I know it works, I'm just curious what hapens underneath)?
Can you explain big mess with new 64-bit architecture?

enter image description here

like image 340
Crazy Yoghurt Avatar asked Sep 20 '13 09:09

Crazy Yoghurt


2 Answers

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 will let you create a single app that supports the 32-bit runtime on iOS 6 and later, and that 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 are saying in future it will be iOS 6.0
  • 32 bit binary will work fine in iPhone 5S(64 bit processor).

Update (Xcode 5.0.1)
In Xcode 5.0.1 they added the support to create 64 bit 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 in the architecture section. This answer will be a followup for you. Check this

like image 189
Anil Varghese Avatar answered Sep 18 '22 09:09

Anil Varghese


My understanding from Apple Docs.

  • What is Architectures (ARCHS) into Xcode build-settings?
    • Specifies architecture/s to which the binary is TARGETED. When specified more that one architecture, the generated binary may contain object code for each of the specified architecture.
  • What is Valid Architectures (VALID_ARCHS) into Xcode build-settings?

    • Specifies architecture/s for which the binary may be BUILT.
    • During build process, this list is intersected with ARCHS and the resulting list specifies the architectures the binary can run on.
  • Example :- One iOS project has following build-settings into Xcode.

    • ARCHS = armv7 armv7s
    • VALID_ARCHS = armv7 armv7s arm64
    • In this case, binary will be built for armv7 armv7s arm64 architectures. But the same binary will run on ONLY ARCHS = armv7 armv7s.
like image 44
sw_engineer Avatar answered Sep 20 '22 09:09

sw_engineer