XCode 4 and iOS 4.2.1 - iphone

I've installed XCode4 and I need to build for iOS 4.2.1 is there a possibility to install the "old" firmware 4.2.1 and build against it?

As far as I understand it you can only use a 4.3 Base SDK but can target also older OSes like 4.2.1 or whatever. So no need to install old firmwares.
Actually it wouldn't make sense any other way. I have a older iPod Touch which can only be upgraded to 4.2.1, so it has to be programmed targeted for 4.2.1 using the same toolset.

Related

iPhone 3G XCode Development for 4.2.1

I've managed to resurrect my old iPhone 3G which runs 4.2.1. Can I still develop using XCode on this phone? I would ideally like to use it for learning Obj-C without paying for the Developers Program, Jailbreaking just to test my apps.
Is this feasible?
Yes it is feasible but you will not be able to use xcode the latest xcode 4.5 with it because it supports ios 4.3 and later. You would be able to use lower versions of xcode for 4.2.1 . 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.
Please go through
Old Xcode
Xcode 4.5 and iOS 4.2.1 incompatibility
XCode 4 and iOS 4.2.1

Is there a way to install older iOS SDKs in Xcode?

I'd like to ensure some backward compatibility for my apps by compiling them using the older SDKs to test for newer classes and methods. However, Xcode is only available with SDKs for the latest iOS versions.
I've downloaded and installed the iOS 3.1.3 SDK (using the method described here) and that works fine. My code is full (not so full :-) ) of __IPHONE_OS_VERSION_MAX_ALLOWED, __IPHONE_OS_VERSION_MIN_REQUIRED and such respondsToSelector.
This works right now for the iOS 3.1.3 SDK, but what if in the future I wanted to repeat this process with the 4.0 SDK? Is there a general process for installing older SDK versions in the latest Xcode?
You can't install old 3.1 SDKs on Xcode 4. You can set the Deployment target lower to allow testing on devices running older OS versions than your current SDK installation. The only current way to completely ensure backward compatibility, while running more recent versions of Xcode, is to keep a device that runs iOS 3.x, and test on that device. (...because it is claimed that the old Simulators/tools sometimes actually allows APIs that won't run on an actual device with an OS of the same version).
Other methods include installing the different versions of iOS developer tools in a separate Developer_XYZ directories, and or keeping around a bootable HD with the older iOS developer tool installation (say Snow Leopard with Xcode 3.x, since Lion might only support running Xcode 4.x).
For whatever reason (I had to do it to debug an Apple bug), if you still need to install an older SDK to your existing Xcode, follow these steps :
Install the older Xcode package
Copy the older Xcode SDK to the new Xcode
Example
(/old/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk to /new/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs)
Restart your 'new' Xcode
You will see the old SDK in the build setting option (base sdk)

Testing multiple iOS versions in Simulator

How can I test multiple iOS versions in the Simulator? I can only seem to test iOS 4.1. I would like to be able to test 3.x versions in the simulator as well.
Cocoa with Love has a good post on how to do this
To allow simulation in 3.1.3, you must
install an old version of Xcode. If
you are a registered iPhone developer,
you can download Xcode 3.1.4 for
Leopard with iPhone SDK 3.1.3 or Xcode
3.1.4 for Snow Leopard with iPhone SDK 3.1.3. Be careful to install these in a different location to your Xcode
3.2.3 with iOS3.2/iOS4 (either select a different hard disk or rename your
existing /Developer directory before
you install).
In the "hardware" menu are options to change the device and the version.
You can install several version of SDK in different path.
To download an older SDK :
http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html

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.

Developing for iPhone OS 3 and 4 on XCode 3.1.2

I am new to iPhone programming and have a MacBook running Leopard with XCode 3.1.2. I want to use CoreData to read and write to plists, but I read on http://tapity.com/iphone-app-development/readwrite-data-on-the-iphone-property-lists-sqlite-or-core-data/ that CoreData is only available on iPhone OS 3.0. Right now, I am developing for iOS 2.2.1. Is there any way I can develop for iOS 3.0 or even iOS 4.0 with Leopard or do I need to upgrade to Snow Leopard?
Thanks!
You should upgrade. Apple approves apps only if they have been built against the latest sdk (even if the target os is a major release back). So, basically, you have no choice if you plan to submit your app to the store ultimately.
Not sure if you can use the latest version of the iOS SDK with the version of XCode you have installed, but that would be an obvious solution. I'm sure you should be able to use at least an early version of the 3.0 SDK with XCode 3.1.
However, I would recommend that you upgrade anyway - there are a lot of other useful features in more recent XCode updates, and Snow Leopard should give you better performance on your existing hardware anyway.