writing an app on iOS 5 - backward compatible? - ios5

Im using iOS5 to write my app. So does that mean it will only run on devices running iOS5 or are these apps backward compatible with other versions of iOS?
If they are not compatible how do I write them so they are?
Any help would be greatly appreciated.
Thanks

In your applications build settings you can set the "iOS Deployment Target" variable. In the current SDK this goes down to version 3.0. You cannot use the latest features then, but your app will run on the specified target. Also be sure that you build for armv6 and armv7 architectures when specifying a deployment target lower that 5.0 (but XCode will warn you in that case).

Related

armv7 and xcode 4.5

I just sent my app to itunes using xcode 4.5 The app is compatible with iphone 3.5 screen and 4 screen. And with the iPad. When I go to binary details it says this:
Supported Architectures : armv7
Whats this mean? Will my app be compatible with all iPhones? Because it should work in any iphone model or ipad model. If no, how can I make it compatible with all devices (adding other architectures?)
Your app will run on the 3GS and later devices, assuming they meet your deployment target operating system version. To run on earlier devices, you need to build for ARM v6 as well, something I'm not sure you can do in Xcode 4.5.
XCode 4.5.x only supports armv7 architecture :
Changes in Xcode 4.5.x for ios 6
Xcode 4.5.x (and later) does not support generating armv6 binaries.
Now includes iPhone 5/armv7s support.
The minimum supported deployment target with Xcode 4.5.x or later is iOS 4.3.
The minimum support for iPhone is iPhone 3GS or later as earlier versions use armv6.
Interesting question, to avoid opening another similar question, what happen if I build my app for submission with armv6, armv7 architectures, iOS6 sdk, xCode 4.5 and deployment target 4.3?
I currently have armv6,armv7 Build settings under Architectures. Screenshot
With these settings I can successfully build and install my app to iPhone4,iPad3 devices and archive for Ad-hoc distribution without any warning about armv6.
Stefano

Installing iPhone app on iPhone

I want to install my iphone app on iphone and also have test provisional profile also. The main problem is that i developing applicaion in mac lion environment Xcode version is 4.2.1
and using iOS5 i want to install it on device iPad 4.3.1 (iOS 4) so it gave me error message on Xcode
The run destination iOS Device is not valid for Running the scheme 'myProjectName The scheme 'myProjectName' contains no buildables that can be built for the SDKs supported by the run destination iOS Device. Make sure your targets all specify SDKs that are supported by this version of Xcode."
What should i have to do for it?
That is because you are using iOS 5 as your deployment target. Go to build setting and set the deployment target as per your need.
In your project settings check for the valid architectures. You need to include both armv6 and armv7 architectures.
Check the Targeted Device Family and make sure the device your distributing to is included in the settings
Please check it with setting deployment target.

Is it possible to target older iOS versions when using Xcode 4.2 and iOS 5 SDK?

I just recently downloaded the Xcode 4.2 with iOS 5 SDK package and I immediately noticed that I am unable to use my iPhone 3Gs with iOS 4.2.1 for debugging. I am only able to debug and test on my iphone 4 with iOS 5 installed.
For any of my devices running any iOS less than 5.0 Xcode just says "Finished running for iPhone3GS" and doesn't run it. I have my deployment target set to 3.0 because I am not using any features in my app above 3.0 and I want to be able to target all versions 3.0 or higher. I have all my provisioning profiles installed and up to date.
I have quit and restarted xcode, I have cleaned the build multiple times. I have tried adding armv6 in the archtecture build settings, but nothing will allow me to build and run my app on my old phone with ios 4.2.1.
My question is, is it possible to still make apps with the new SDK work for iOS versions lower than 5? How can I be sure that my app will still run on lower iOS versions if I am unable to install them on my old phone?
Edit:
OK it looks like iOS SDK 5 dropped support for armv6 by default. What you have to do is add armv6 in the Architectures field under Build Settings for both your Target and your Project. Then your app will be able to run on iPhone 3G devices.
Answer can be found here
How to build for armv6 and armv7 architectures with iOS 5
I was having the same issue trying to get a newly created Xcode 4.2 project running on an iPhone 3G 4.2.1. Here is how I was able to get it to run.
1) Change the Target's "Build Settings" ==> "Architecture" from "Standard (armv7)" to "other". Add armv6 and armv7.
2) Change the Target's "Build Settings" ==> "Valid Architecture" to armv6 and armv7.
3) Change the Target's "Build Settings" ==> "iOS Deployment Target" to iOS 4.2.
4) Open the projects *-Info.plist, remove the setting "Required device capabilities" (note it required armv7)
btw I figured this out when I tried to manually add the app via the organizer and it reported:
Can't install application
The Info.plist for application at /Users/.../TestsDebug.app specifies
device capability requirements, which are not met by Dev iPhone 3G
All should work after that. Talk about a PITA.
Go to Xcode > Preferences > Downloads and install debugging support for older iOS versions.
mmorris got me close to resolving the issue...
In the Info.plist, I had to set the Required Device Capabilities to armv6, not armv7
Hope this helps others out as well.
You need to connect the phone and then go to the organizer. Xcode should automatically request the older version.
See the developer page for more info. It was described in the notes for the 4.2 beta
I encountered a similar problem trying to run my app on an old iPod Touch. I upgraded to Xcode 4.3.3 and the app would no longer run in the debugger for me on older hardware.
I believe the other comments here about "Architectures" and "Required device capabilities" are important details to specify correctly. Unfortunately, they weren't enough to fix my problem.
In my case, I found the build scheme to be the culprit. Xcode 4.3.3 prompted me to switch from the GDB debugger to LLDB when it upgraded my project. When I changed the Run action of my scheme back to GDB, I was able to run the app again on my old hardware from Xcode.
I found out that I had to add armv6 to architectures, but still did not work. And now I have removed armv7 from required capabilities, and that was it! It worked!
This worked for me and should work for you if you had an older version of Xcode previously. If not then you should follow the advice given by others to obtain the SDK from an older version of SDK:
sudo cp -a /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
This command is only a little bit different from that shown by others, but those commands dropped the files in the SDKs folder itself for me - we want a subdirectory of it to be created with the appropriate name.
In my case there was a redundant line
in Required device capabilities
I just removed it...
Hopefully it will help someone else.

Xcode: Architectures settings for a universal\iOS4 app

I was wondering what my project settings should be in case I have a universal app that I am now updating to 4.0.
The Base SDK is iPhone Device 4.0
iPhone OS Deployment Target is iPhone OS 3.0
What should I enter in the Architectures, Build Active Architecture Only checkbox and the Valis Architectures for the different configurations (debug, release)?
Also, since some of my apps are not universal but will support 4.0 as base and 3.0 as deployment, will it make any difference is the architectures settings?
Thanks
Roi
Base SDK should be set to the most recent version of the SDK (ie: 4.2) this is what you build against and ensures that your app works properly on new OS's. Xcode now has a 'Latest iOS' selection which I recommend.
Deployment Target is the minimum version you want your app to be able to be installed on. This is mostly dictated by the features you want to use. If you want features introduced in iOS 4, you need to set the deployment target to 4.0.
also, be careful that these are set identically for all configurations and don't vary between development and release.

Building/Testing a Universal iPhone/iPad application

I have a project configured (I think) to produce Universal binaries. The base SDK is set to 3.2 and the Deployment Target is set to 3.1. Target Device Family is iPhone/iPad and the architecture is armv6 armv7.
I had a few questions about how this Universal binary thing really works:
1) When I want to submit an app binary for review, what configuration should I set as the build target? If I set it as "Device - 3.1" I get a warning which says "warning: building with Targeted Device Family" that includes iPad('1,2') requires building with the 3.2 or later SDK". However, if I build with SDK 3.2, will it still run on iPhones with OS 3.1?
What's the right configuration for device and architecture (arm6/arm7)?
2) How do I test the scenario above (built with SDK 3.2, but installed on a device running OS 3.1)? If I build with SDK 3.2, when I try to install it on a phone with OS 3.1, I get an error saying that the phone's OS isn't updated.
Thanks!
Our first Universal App just got approved and released in the App Store today, so here are the settings we successfully used:
Architectures
Architectures: Optimized (armv6 armv7)
Base SDK: iPhone Device 3.2
Build Active Architecture Only: unchecked
Valid Architectures: (empty)
Deployment
Targeted Device Family: iPhone/iPad
iPhone OS Deployment Target: iPhone OS 3.0
(you can set this to any iPhone 3.x OS but we wanted to target the oldest devices possible. This must be 3.0 or above, 2.x is not valid for a Universal App.)
Make sure that you'd also checked these settings for the Target itself (Project->Edit Active Target "AppName"); my initial problems when uploading to iTunes Connect were because the iPhone OS Deployment Target for the Target itself was still set to 2.2.1.
So, the key seems to be that the "Architectures" setting be set to "Optimized (arm6 arm7)" in addition to the "Valid Architectures" setting being set to "armv6 armv7".
This allows it to compile with the 3.2 SDK and run on an iPhone running 3.1
The settings I have in my question, in addition to this above change, seems to be what's needed to configure the app for submission as a universal binary. I haven't done it yet, but I'm fairly confident.
Please correct me if I'm wrong.