The current (as of Dec 2008) iPhone SDK allows me to pick between 3 versions when I want to build an app: 2.0, 2.1, 2.2. -- I'll ignore 2.1 below.
My assumptions:
2.2 has more API functions available than 2.0,
2.2 has fixed bugs since 2.0,
2.2 is backward-compatible with 2.0 (both for building and running),
If I build with SDK 2.0, my app will work on iPhone 2.2,
If I build with SDK 2.2, my app won't work on iPhone 2.0.
I would think that using the earliest version that can build the app would be best, this way it will run on iPhones running older OSes.
But is there a risk that my app would be missing something if I built it with 2.0? Maybe some speed or nicer UI elements. But maybe there's not that much difference between 2.0 and 2.2 to even worry about it?
So my question is: Which SDK should I select?
The earlist SDK I can build with, to broaden my target market.
The latest SDK always, so that my app benefits from improvements -- at the cost of potentially reducing my market.
(And if the answer is obvious, why do I have a choice?!)
You can use the iPhone OS 2.2 SDK and still compile for iPhone OS 2.0; the way you do this is the same as for Mac OS X. The SDK you use determines the most recent version of the OS you want to use API from, while the Deployment Target you use determines the least recent version of the OS you want to run on. Both of these should generally be set at the project level in Xcode.
So you can build your software against the iPhone OS 2.2 SDK and, when running on devices with 2.2 or later installed, use 2.2 features. But you can set its Deployment Target to 2.0 and not use 2.2 features when running on a device with a pre-2.2 operating system installed and your application should work fine.
I'd pick option #1 - compile it to 2.0. This is what we do for our app. There are still a lot of people running the old 2.0 O/S and if you compile to 2.2 your app won't run on their device.
That said, if you develop your app and run into a bug and find out that it's been fixed in a later firmware version, you may not have much of an option unless there's a workaround. There are also new features added to each new version although I do not know of a comprehensive list of what those features are (at an API level).
In my testing, if you use 2.0 you can't make use of the application badge functionality - that appears in 2.1 (so you may need to at least use that level)
Tim
Related
I have written an app and its base SDK is set to 4.2, and at the moment it is in the app store with a deployment target set to 4.2, I'm sure you'll agree this is a bad idea because I am alienating all potential users who do not have the latest version of iOS installed.
So my question is, when deploying for an older version of iOS, how do I make sure it will run, i.e. how do I check whether I've used any modern API's that are not present in the deployment target iOS version?
The only sure-fire way to make sure your app will run is to test on a device running the older OS version you specify.
Even old versions of the iPhone Simulator (if you can find such) will not do a good job of checking for compatibility.
Most developers who want to support customers on iPhoneOS 3.x have access to an old test device, such as an used iPod Touch (hand-me-down, or purchased on eBay, etc.) running the OS version set in the app's Deployment Target. Otherwise, the developer is just guessing/gambling.
Check the documentation of the libraries or methods you are using. Test on the actually device installed with the version of the OS you wish to support.
Change the Base sdk version to 4.2, target sdk to 3.0 or any.
test the app in simulator as the target as simulator 3.0 r any.
But, when compared to 3.2 , 4.2 version has many new functionalities that do not work on 3.2 version devices.
So take respective steps to do for 3.2 r for 4.2.
The better idea is to find the version of the device , then give the accessibility based on the version.
Thanks,
Bharath
i'm writing my first iPhone app with aim to upload it to the AppStore and don't understand one thing:
Most popular games on the AppStore have compatibility with iPhone OS 3.0 or later. I have currently installed iPhone SDK 4.0 i believe.
I want my app to have the same compatibility starting from 3.0, do i have to install and use in development an earlier SDK, like 3.0 to achieve that goal or i can somehow use the latest SDK?
Thanks for any help!
You should always build against the most current SDK, that is 4.1 at the moment. You can set your minimum requirement differently though, i.e. 3.0.
To be able to upload your application to appstore you must build it using SDK 4.0 at least.
Then in build target settings you can specify minimum OS version your application can be run on - check "iPhone OS Deployment Target" setting.
Remember that if you use some APIs that are available not on all OS versions you support you should do run-time checks for them to avoid application crashes.
I installed SDK 4.0 and found that I lost access to all previous SDK versions prior to 3.2.
I have found a link to download SDK 3.1.3 so I have both .dmg install files.
Questions:
Does SDK 4.0 not allow access to earlier version?
If the answer above is no then does that mean I have to have two versions of SDK installed?
If yes to the above....how?
Thanks in hope
The terminology is confusing but once you understand this it's easy.
The 'Base SDK' is just the version of the SDK that you are compiling against. So you can use any classes, properties, or methods in the Base SDK.
The Deployment Version is earliest version of the OS that you want users to be able to run your code against. If you use a feature available in the Base SDK version but not in the Deployment version then your code will launch on both versions but will crash on the earlier OS version when you use the new feature, so you need to check if the new feature is present if you want to do this.
So you don't need Base SDK of 3.0 to run on 3.0 - just set Base SDK to 4.0 and Deployment Version to 3.0 and don't use any features of the SDK that weren't present beyond 3.0.
The deployment target can be set to anything (even 2.2), but the Base SDK has nothing except 3.2 and 4.0. I would have thought if you set the deployment target to 3.0 for example, that the Base SDK could also be set to 3.0.
So if the deployment SDK is 3.0, and the base SDK is 4.0, which one is being compiled for?
Note in the new SDK, you can't select anything other than 3.2 and 4.0 as mentioned above.
Looks like a problem with apple. I am also getting:
"Base SDK Missing" after installing Snow Leopard and the iPhone SDK 4.
There is no Base SDK in my case.
I'm a newbie to the system and meant to make this a comment, not an Answer.
UPDATE:
After reading the readme that comes with the SDK 4 a little closer, I see that it (xCode 3.2.3 and it's iPhone SDK4) does not support iPhone prior to 3.2 - the solution is to install the older SDK in a different directory. Also, don't forget to update your device if you use the newer xCode/SDK.
ANOTHER UPDATE:
Please ignore this ANSWER and see the one above that was provided by aizuchi. Don't forget to read the part about Base SDK area being a different thing from Deployment.
As I understand it, using any SDKs other than 3.2 and 4.0 is now deprecated for app store submissions. Therefore, logically, those other SDKs are no longer options in xCode (3.2.3) either. IMO, trying to get around this is futile. I've written a community wiki that explains it more fully here.
You need to set the Base SDK to the latest version and set the iPhone Deployment Target to 3.0 for example.
It's recommend to test your application for earlier versions.
After my upgrade to Snow Leopard and Xcode 3.2 (which I really regret a lot!!), Xcode lost all the SDK's. I'm one of those old-fashioned idiots who still want to develop for 2.2.1. But Apple does not offer me an old SDK download.
Now I was clever and made tons of time machine backups. But: What's the preferred way to get iPhone SDK 2.2.1 running with Xcode 3.2? Some guys said that's generally possible. I do hope so because I still don't believe in all those "faked" stats, and besided that, my app doesn't benefit from 3.x additional features so I would not want to constrain my market just for that lazyness.
Any idea?
Regardless of whether or not you're targeting iPhone OS 3.0 or not using any 3.0 specific features, you should always compile your app against the latest SDKs to benefit from bug fixes and performance improvements.
You can compile against the 3.0 SDK and set the iPhone OS Deployment Target to 2.2.1 and still cater for users who are using 2.2.1.
You may find that some methods have been deprecated, but that doesn't stop you from using them until you're ready to move on.
Get the 3.1 final sdk, it has the 2.2.1 sdk in it. On disk its usual location is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk
Also included is 3.0 and 3.1.
XCode 3.2 should have the prior iPhone SDKs available, just make sure you are setting your project's Base SDK setting to "iPhone OS 2.2.1". (Right-click on your top-level project icon in the Groups & Files browser in XCode and choose "Get Info", then go to the Build tab.)
Raffaello and others are correct: you can use the latest SDK and still target (and test on) older SDKs. For example, I'm using iOS4.0 (xcode 3.2.3) and testing on my iPhone 3g running 3.1.3.
To clarify the procedure:
- go to project info > build tab
- set Architectures:Base SDK (most likely) the latest
- set Deployment:iPhone OS Deployment Target to what ever you want (I have the option to go as far back as 2.0).
Hope this helps someone.
Like I said on other threads, the SDK and Deployment Target are different.
You can still use the latest SDK to build for an older OS.
Just go to your Target settings and under the Deployment section set the iPhone OS Deployment Target to whatever you'd like.
Cheers,
Raffaello Colasante
Hello I have recently uploaded an application to the app store and it got approved. The issue is the application has been compiled using the 3.1 sdk, and thus is not working on 3.0 devices. Would there be any problems if i resubmitted the application compiled using the 3.0 sdk? (I want to support 3.0 because a lot of people still have not upgraded their devices, and I don't have any feature that differ between 3.1 and 3.0)
Depending on whether or not you're using any APIs that are restricted to version 3.0 or 3.1 you should set your base SDK as the highest version that the latest official SDK supports (not beta SDKs).
After doing that, you should then set your deployment target in your build settings to the lowest version of iPhone OS that you want your app to run on.
So if you're not using any API's that are specific to 3.0 you could compile against the 3.0 SDK and then set your deployment target to 2.0.
This way you benefit from most of the bug fixes brought along in the SDK update, but still retain the wide user base of people who didn't upgrade.
You can resubmit to 3.0 if you wish, I remember the NYTimes application was at 2.2.1 and a future update released as 2.2 since a large number of people were still using 2.2. So long as your application has been tested to work properly on 3.0 and the 3.0 binary works on 3.1 you'll be fine. Just you'll need to wait for the approval process again.
You can compile your app using whatever version you like. It just has to run on 3.1.
This answer is somewhat related as to what you can compile with versus what you have to test against for compatibility.