How to get iPhone SDK 2.2.1 for Xcode 3.2? - iphone

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

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

XCode and recent iOS SDK

I am currently using XCode 3.2.2 and iOS SDK 3.2. With these I can produce binary which works on iPhone 3.1.3. If I upgrade to XCode 3.2.4 and iOS 4.1, would I still be able to build binaries for iPhone 3.1.3 device? If no, can I install both, or it's tricky?
Eiko is correct, what's more I believe that apple will no longer accept applications built with pre 4.x SDK.
To get this set up you need to change the following settings
Set the "Base SDK" in your projects settings to the newest version number of iOS whose features you may want.
Set the "iPhone OS Deployment Target" to the oldest version number of iOS that you will support.
Courtesy of CocoaWithLove
Regarding installing multiple versions, it's not tricky... just awkward. The release versions of XCode are installed into the /Developer directory. To install multiple versions you need to move the /Developer directory to something else e.g. /OldXCode and then install the new version (Which is put into /Developer)
Hope that helps
You can, and you should, always use the latest SDK.
You can easily build agains 4.1 and still target 3.x - in fact most developers do this at the moment.

Simulate iPhone 3.0 with SDK 4.0

i have xcode 3.1.3 and xcode 3.2.1 installed
For sure now I use 3.2.1 with Sdk 4 to develop new apps.
But what if I like to test a App compiled with sdk 4 on a
simulated iphone that would just have 3.0??
As BaseSDk i use 4.0 and as target 3.0
In xcode 3.1.3 i could select a simulator down to 2.x but with sdk 4.0
i only have the option 4.0 iphone or 3.2 ipad
Example> i know iAd is not supported before 4.0 so I set the
framework to weak. But just to be sure all works fine I really
would like to test my app in a simulator that simulates an iphone with 3.0
thx
chris
The new simulator does not seem to be able to run the old simulator OSs (3.2 being the oldest it'll run). I tried moving them over from old SDK installs and several variations and "no go".
You can check that you aren't using methods defined in the new SDK, when you set the base SDK to 4.0 but set the Deployment to to 3.1.3, for example. For a blog post on how to do this see this blog post, and note my comment on an easier way to do the last two steps (no need to edit the project file as a text file).
inside the iphone sdk dmg file, there should be a folder called packages. in it, you'll find packages like iPhoneSDK3_0 and iPhoneSimulator3_0. Install them to be able to use them in xcode.
Correct me if I'm wrong, but I think a device with 3.0 installed can't even run apps compiled with 3.2 or 4.0. Furthermore, Apple now only accepts iPhone apps (including updates of existing apps) linked against the 4.0 libraries, which won't run on OS version 3.0 devices.
So why do you want to test your app on a 3.0 device?
Try setting the architecture you want to build for in the Xcode project preferences and rebuilding.
If this doesn't work, completely uninstall Xcode and downgrade. You have to completely uninstall because your system must have updated the frameworks for 4.0.
Hope this helps

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

Choosing iPhone SDK in latest Xcode: Only 3.0 SDKs are available, but I have 2.0 on disk

After I downloaded the latest Xcode with the 3.1.2 SDK, I can't build and test for 2.2.1 anymore. I have the 2.2.1 SDK in the proper directory of my Developer folder.
Is there a setting I have to change?
Yes, to choose an older SDK in the Active SDK popup you have to set either the Base SDK or the Deployment Target build setting of your target to a value equal to or less than 2.2.1.
The Base SDK expresses your intention of what API your code is written for.
The Deployment Target expresses your intention of the earliest iPhone OS you want your app to run on.
The Active SDK is your build-time choice of SDK to use, usually Device vs. Simulator. But you will fail if you try to build against an SDK that is older than what your code is written for. If you code is indeed written to compile against older SDKs and/or run on older OS versions, you must express this by setting the appropriate build settings in the Target. Otherwise the Active SDK popup will limit you to what it knows will work with your code.
Where are you trying to select it? As the base SDK?
You should always be linking against the newest SDK version (this is what an Apple engineer told me directly at an iphone dev event) and then set your Deployment Target back as far as you want. You should be able to set you iPhone OS Deployment Target back to the older SDK version.
This is because Xcode uses weak linking so it will leave out things from the newer SDK on older versions, you do need to do some conditional checking for specific API's/functions using things like respondsToSelector if you are using functionality that has changed across versions.