Which iPhone SDK to use for compatibility - iphone

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.

Related

when deploying an iOS app for an older SDK, how to test it?

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

Can a user install iphone application developed using 3.1.3 in his iphone 3.0?

Can a user install my application from iTunesStore if he is having iPhone OS 3.0 or having lower version of iPhone OS and I have developed my application using iPhone SDK 3.1.3...
Can anyone help me with this...
Thanx in advance...
In you projects settings, use a build setting named "iPhone OS Deployment Target" to specify your minimal iPhone OS version.
To do that, double click the blue project icon (at the top of the project’s "Groups and Files" table), click the "Build" tab and find the setting in the "Deployment" settings section.
To use features from a later iPhone OS, see this question.
If you compile your application to target iPhone OS 3.1.3 then it will not run on 3.0 - instead the user will get a message telling them to update their OS when they try to install.
However, there's a good chance that you will be able to compile your app to target 3.0 as long as you're not using any specific 3.1+ and newer features. To do so, just change the Active SDK you target in Xcode before you compile. Then your app will run on both 3.0 and 3.1.3
If you set your Target SDk in Xcode to 3.1.3, you may be using features of the SDK not found on an iPhone running a lower OS. However, you can test for those features in your program and take alternative measures if the user does not have those features/frameworks available. There is nothing that will prevent your app from running on older iPhone OSes, other than the fact that using new features will cause the app to fail.
On the other hand, you use the Deployment SDk value of XCode to limit which iPhone OSes can actually run your app. This way you can limit the app to be available to only iPhones with later OS and not the earlier ones. The Apple iTunes App Store will use the Deployment SDk value to tell the user who is purchasing, what the minimum system requirement is too.

iPhone: Minimum OS, Deployment Target & Base/Active SDK

I'm a little confused about building an app for the app store and for the correct SDK & OS version. I have submitted my app to the app store, and in the app details screen of iTunes connection it says:
"Minimum OS Requirements : 3.1.2"
I haven't seen any apps on the app store that have 3.1.2 as the min OS, they all say 3.0. I read several things on here before I built it and I thought I understood everything!
Basically, my app doesn't use any code that only exists in > 3.0 so I would like the minimum OS to be 3.0. My build settings were:
Target Info
Base SDK: iPhone Device 3.0
iPhone OS Deployment Target: iPhone OS 3.0
Xcode Main Window
Active SDK: iPhone Device 3.1.2
I've heard about a minimum OS version being put in the Info.plist but I haven't got anything like that in mine.
I build the app exactly like that and submitted it. Are my app settings correct? Will my app display 3.0 in the app store or 3.1.2? I'm a little unsure as to why you set the Active SDK to the latest (3.1.2) when you want to target 3.0 , 3.1 & 3.12 devices, but it's what I read!
Any help advice be greatly appreciated!
Okay I've managed to figure it out after much reading!
Basically, the Active SDK is just a build time override of the Base SDK. By default, when the Base SDK changes it automatically changes the Deployment Target to the same OS as the SDK. So when I wanted to build the app under the 3.1.2 SDK but have it run on 3.0 OS, I changed the Active SDK to 3.1.2, but that had automatically changed the minimum OS (deployment target). I saw this by looking at the Info.plist file in the package contents in my .app file.
So the best thing to do is to set the Base SDK to the latest SDK (currently 3.1.2) and then manually set the Deployment Target to 3.0 OS. Once the 2 are different then it will no longer automatically change.
However, this means that your app can install on a 3.0 device that may have 3.0, 3.1, or 3.1.2 SDKs. Therefore, any frameworks, methods or properties you use that are only available in SDKs greater than 3.0 you will have to use conditionally.
When you get around to building the app, ensure that that Active Target is set as the same as your Base SDK, e.g. Device 3.1.2. But remember to compile your app under Device 3.0, Device 3.1, and Device 3.1.2 just to check for compiler warnings. This will ensure that you don't have any code accessing methods/frameworks that don't exist in any SDKs down to your Deployment Target.
I hope this helps anyone who is in my position and couldn't find a simple explanation of how it all works.
The SDK Compatibility Guide was very useful and informative. However it took just a little extra figuring out for me to be comfortable with the concept and how everything works. This image from the guide is useful:
(source: apple.com)
Go to the Project Info->Build and look at IPHONEOS_DEPLOYMENT_TARGET property
Actually I use 3.1.2 SDK and building an app that work nice on every OS higher than 2.2.1

How to get iPhone SDK 2.2.1 for Xcode 3.2?

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

If I install the 3.0 SDK, can I still make 2.0 compatible apps?

I've been putting off installing the 3.0 beta SDK in case I can't make apps to target 2.0. If I install 3.0 on my computer and iPhone, will I still be able to submit apps to the app store for users with 2.0 iPhones to download? Will I have to wait until 3.0 is released to submit more apps?
Actually, I suggest testing on OS 3.0 as it's a requirement your app doesn't break on the new OS.
"New iPhone applications will be
rejected unless they are ready for
Apple's forthcoming iPhone 3.0
firmware upgrade, developers have been
informed."
You can still build for 2.* but I can see how testing on only one device can make you nervous. There is no way to rollback to a previous OS once 3.0 has been installed. So, if this device is also your everyday cell phone, make sure you accept possible bugs. (though I haven't heard of any seriuous problems. OS 3.0 is worth it)
As for the issue you address. Apple says:
"iPhone SDK for iPhone 3.0 can not be
used for submitting iPhone OS 2.2.1
applications to the App Store."
I think they didn't express themselves too well. While technically spoken, they are right, you just have to select SDK for 2.2.1, and you're good to go.
Yes you can build 2.* apps. No you can't submit pre 3.0 apps to the app store. I can't paste the link for you since I am considered a new user, so just google "iPhone 3.0 app submit".
I understand that you wrote this a while ago and you've already accepted an answer, but I have some more advice:
You should install two copies of the SDK, the latest stable version (in "/Developer") and the latest beta version (in "/Developer Beta" or similar), as per these instructions.
For building 2.x applications, you set your "Base SDK" to 3.0 and your "iPhone OS Deployment Target" to 2.2.1, as per these instructions.
You can get it free or roll back if you do not like the new software at http://www.felixbruns.de/iPod/firmware/
download then follow these steps
1.) after it downloads open itunes and plugin your ipod/iphone
2.) Hold shift if on windows (Option key on mac) and then click resotre
3.) Select the ipod file and then wait for restore
4.) you will need to set up as new ipod (it will be slow if you restore from backup
The installation of the 3.0 SDK mentions weaklinked frameworks --
The Xcode UI now allows you to
designate a library or framework as
weaklinked, to support building with
newer SDKs while targeting older OS
versions.
I have yet to accomplish this, but will update once figured out.