arm64 armv7 armv7s Architectures settings - ios

Criteria:
iPad only app. Only support iPad 2 or later.
Want to take advantage of 64 bit code for the latest iPads.
Min iOS 6.
Xcode 5.02 with iOS 7 SDK (current release)
Should I set both Architectures and Valid architectures to arm64 armv7
armv7s?

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. If you have an existing app, you should first update your app for iOS 7 and then port it to run on 64-bit processors. By updating it first for iOS 7, you can remove deprecated code paths and use modern practices. If you’re creating a new app, target iOS 7 and compile 32-bit and 64-bit versions of your app.
The architecture for 64-bit apps on iOS is almost identical to the architecture for OS X apps, making it easy to create a common code base that runs in both operating systems. Converting a Cocoa Touch app to 64-bit follows a similar transition process as the one for Cocoa apps on OS X. Pointers and some common C types change from 32 bits to 64 bits. Code that relies on the NSInteger and CGFloat types needs to be carefully examined.
Start by building the app for the 64-bit runtime, fixing any warnings that occur as well as searching your code for specific 64-bit issues. For example:
Make sure all function calls have a proper prototype.
Avoid truncating 64-bit values by accidentally assigning them to a 32-bit data type.
Ensure that calculations are performed correctly in the 64-bit version of your app.
Create data structures whose layouts are identical in the 32-bit and 64-bit versions of your app (such as when you write a data file to iCloud).
Reference: apple doc

Yes. You can set both architectures for your above criteria. But problem is, you should handle code for both cases(32-bit & 64-bit).
Note:
Additional Notes for you.
You can support from Minimum IOS 5.1
You can use Xcode 5.0.1 with IOS 7 base SDK

Related

Can we make an iOS app backward compatible

Can we make an iOS app backward compatible with older iOS versions?
As we can do in android apps using API Levels?
While building an iOS app, the architectures (armv7, armv7s, armv64) you choose dictate what all platforms you will be supporting. The "Deployment target" version that you select in xcode is the minimum OS version that you can support. An iOS app is a universal binary, which means that it can contain code supporting both 32-bit and 64-bit architectures. Building with 64 bit support (iOS 8 SDK) is not the same as dropping support for earlier 32-bit OS versions.

What does Apple mean by telling about 64bit requirement for extensions on iOS8?

What does apple really want to say with the bold sentence?
For example, I have 3rd party libs in my application which are not compiled as 64bit, but I do not use any of them inside the extension. Should I "still" compile 3rd party libraries of the containing app (my main app that includes the extension) for 64bit architecture? (I don't want to do that as it is very hard also it will double the size of my app as I don't even target armv7s but just armv7)
Note about 64-bit architecture
An app extension target must include the arm64 (iOS) or x86_64
architecture (OS X) in its Architectures build settings or it will be
rejected by the App Store. Xcode includes the appropriate 64-bit
architecture with its “Standard architectures” setting when you create
a new app extension target.
If your containing app target links to an embedded framework, the app
must also include 64-bit architecture or it will be rejected by the
App Store.
For more information about 64-bit development, see 64-Bit Transition
Guide for Cocoa Touch or 64-Bit Transition Guide for Cocoa, depending
on your target platform.
Reference: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html
It means that your extension must have a 64-bit version. That means that if you use framework you must include a 64-bit version.
If the code is used only in the main app and not the extension then it doesn't need to be 64-bit.
Having said that, it's been over a year since the first 64-bit iOS devices became available. Even if you can't build fully arm64 right now you should probably have a plan to migrate.

Is it possible to create an app iOS 4 - iOS 7 compatible with Xcode 5.0.2 on Mavericks?

I need to develop an app who support iOS 4 - iOS 7, is it possible to do it on XCode 5.0.2 on Mavericks?
The lowest deployment target xcode provide me is iOS 6.
In Project > Target > Build Settings > Architectures:
change the Architectures from Standard Architectures (including 64-bit) to Standard Architectures ,or if you want to support older devices, type armv6 armv7 armv7s in Others
Then, you can change the deployment target to lower versions (just type 4.0 or 4.3 in the Deployment Target box)
But why do you want to target iOS 4 still?
Yes, supporting iOS4 is possible, the problem is supporting ARMv6 (iPhone 3G and iPod Touch 2G).
To support ARMv6, you need iOS SDK 5.x with is available in Xcode 4.4.
But you also need to support the widescreen iPhone resolution, so you need to use two different Xcode versions for it
Try this , You will get the deployement Target till from lowerEnd . Its mainly due to the >XCode 5.0 choses by default architecture as including 64-bit this only supports >IOS 6.0
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.

Xcode 5: about 64-bits architecture and backwards compatibility

I've developed an iOS app whose Deployment Target needs to be 5.0, so the target's Build Settings > Architectures > Architectures value has to be the standard without the 64-bit one (XCode complains about my deployment target if I try to include it).
I've read this post: Xcode 5 and iOS 7: Architecture and Valid architectures dealing with this backwards compatibility, but some things are still not clear for me:
They say in that post that last Xcode update allows to build both 32-bit and 64-bit but only for a deployment target of iOS 5.1.1 and later. I'm targeting iOS 5.0, how should I handle this? Will Apple reject my app if I only submit a 32-bit build and I don`t take advantage of iPhone's 5S 64-bit processor?
And finally they don't explain the difference between Architectures and Valid Architecures values in target's Build Settings, could somebody explain that?
Thanks!
Recommendations
I'm targeting iOS 5.0, how should I handle this?
Based on your requirement it appears the only option is to build the 32 bit app only. This should work on the iPhone 5s in 32 bit mode.
Will Apple reject my app if I only submit a 32-bit build and I don`t take advantage of iPhone's 5S 64-bit processor?
No. It has been publicly stated that 32 bit apps will continue to run on iPhone 5s although there is a known bug where 32bit apps will not support bluetooth operations on a 64 bit device (link). I have submitted a 32 bit app to the store which ran fine on iPhone 5s.
And finally they don't explain the difference between Architectures and Valid Architecures values in target's Build Settings, could somebody explain that?
To read the full explanation see the Xcode Build Settings documentation, but in essence just note the reference to the intersection of the two architecture settings. Actual supported architecture will be the intersection of values (one or the other setting may be empty but not both or no binary will be output).

Xcode 4.5 and iOS 4.2.1 incompatibility

The latest release notes indicates 4.2.1 and lower will not be supported, we now have to use 2 version of Xcode to develop when supporting older devices?? This is going to be difficult to support older devices if we want to develop iOS6 AND support 4.2 and lower.
I don't think Xcode 4.4 will support iOS6. So this is the issue. How would developers easily support these platform without so much hassle?
You can do this, but it requires some minor Xcode hacking, and some sacrifices. Depending on what you mean by "support iOS 6", this may or may not be sufficient for you. If you just want your app to run on iOS 6, then this should work. If you also need your app to incorporate new iOS 6 features, then it won't.
(Note for others who don't have a problem using multiple versions of Xcode: this similar question has answers that do allow you to also use new iOS 6 APIs and directly target armv7s)
See basic instructions on chpwn's blog here (but read the rest of this below, too!)
Basically, you can use Xcode 4.5 to build for iOS 4 and above, but then you can't take advantage of the new iOS 6 only features. So, you're really building for iOS 4 and 5, and assuming that the app will run fine on iOS 6 (which should be true, but you'll need to test this yourself).
You'll need to copy the iOS 5 SDK folder
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.*.sdk
from an old Xcode installation (which you'll need to keep around briefly, or reinstall to a non-standard location). You'll then set the Deploy Target in your Build Settings to iOS 4.0 (or whatever minimum OS you want). You may need to open the project.pbxproj file in a text editor to set this manually:
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
You'll also need to set the Architectures to armv6 and armv7. You cannot directly also target armv7s. But, that doesn't mean your app won't run on iPhone 5. armv7 executables should run on iPhone 5, simply without any optimizations added in armv7s. It's just that compatibility doesn't work in the other direction (e.g. armv7 executables don't run on an armv6 iPhone 3G).
There's also a step that might be necessary, that's not mentioned in chpwn's blog. You may get these warnings (which really are errors, because Xcode won't generate your executable properly):
warning: no rule to process file '$(PROJECT_DIR)/main.m' of type sourcecode.c.objc for architecture armv6
In order to fix this, you'll need to setup a custom Build Rule for your target that tells Xcode to use LLVM GCC 4.2 to generate armv6 code. Define the rule for files matching the pattern *.[mc]:
This will be a different compiler than the Xcode default, and you may need to adjust some of the syntax in your Objective-C code. Even though many people wanting to do this probably wrote their apps before ARC, it is important to note that LLVM gcc 4.2 does not support ARC.
Finally, you probably will still see warnings from Xcode about iOS deploy targets less than 4.3, and armv6 not being supported. Those, I found, were not problems, and could be ignored:
Running lipo -info on my app executable after this shows the desired result:
lipo -info MyAppName
Architectures in the fat file: MyAppName are: armv6 armv7
Xcode 4.5 makes iOS 4.3 the earliest supported operating system, which effectively orphans the original iPhone and the 3G.
If you want to support iOS versions earlier than 4.3, you will need to keep around a 4.4 version of Xcode.
To be a bit clearer : you cannot easily (meaning Xcode does not out-of-the-box) support pre-4.3 devices and use iOS 6 features in the same app. That's because iOS 6 features require XCode 4.5 which also sets iOS 4.3 as the minimum supported OS.
So, you have 3 choices :
Continue using XCode 4.4. You'll be able to target pre-4.3 iOS. You won't be able to take advantage of iOS 6 features, but your app should run fine on it assuming you perform adequate testing on actual iOS 6 devices.
Migrate to XCode 4.5. You won't be able to target pre-4.3 iOS, but you'll be able to take advantage of iOS 6 features.
Make two versions your app. Build one version with XCode 4.4 (as in option 1), and the other with 4.5 (as in option 2). From the point of view of distribution, these will be 2 separate apps, they'll each have their own bundle ID, etc. You will have two entries in the app store.
If you are comfortable going beyond what is supported directly by Xcode, see Nate's answer.
The original iPhone and iPhone 3G are the only devices that don't support iOS 5. The iPhone 3G is now 4 years old. You may want to consider dropping support for iOS 4. If you don't want to do that, I think you'll have to develop in two different versions of Xcode.
I assume that the dropped support for iOS 4.2.1 is not the core problem. In fact, I tried to work around this and do the following:
Build the app with iOS 6 SDK, setting deployment target to iOS 4.2.1 (which works).
Pack the app for ad hoc installation and install the app on an iOS 4.2.1 device (iPod touch 2G).
Test the app.
However, installation fails. The reason here is - afaik - not the iOS version. The reason is the architecture. XCode 4.5 no longer allows you to build for armv6. It only builds for armv7. On the other hand: all device which have armv7 or better can run iOS 5. The only devices which do not support armv7 are iPhone, iPhone 3G, iPod touch 1G and iPod touch 2G.
So for me the question is: can you build for armv6 with XCode 4.5 and iOS 6 as base SDK?
Edit: Which you cannot do, because the iOS 6 base SDK is not available for armv6. Right?
Try to set the project settings manually using IPHONEOS_DEPLOYMENT_TARGET=4.0. However, I don't know if there is any side effect.
I think that targeting to 4.3 is the best choice, according to ios version statistics

Resources