Earlier this week, I used a Mac Mini with OS X 10.6.8 (Snow Leopard) and Xcode 4.2 with iOS SDKs and devices support ranging from 4.2.1 and 4.3 to 5.0 - before my iPhone alerted me that a minor software update to iOS 5.1 was ready to be installed.
This blog post is mainly meant to "warn" Delphi XE2 FireMonkey for iOS developers who have not yet upgraded their iOS devices to 5.1. First read this post, because it may save you some time...
The installation of iOS 5.1 on my iPhone (previously running iOS 5.0.1) required about 1 GB of storage on the iPhone, plus about an hour to download, verify, install and reboot the device. Unfortunately, when I plugged the iPhone back into the Mac Mini to start deploying applications on it using Xcode 4.2, I got an error message telling me that Xcode had just seen an unrecognised device: the iOS version was not supported by the available SDKs and supported devices, but I could download an upgrade from the Apple developer site. That link didn't really tell me where the iOS 5.1 SDk was, but instead everything pointed to the new Xcode version 4.3.1, with support for iOS 5.1.
Unfortunately, the AppStore refused to let me download Xcode 4.3.1 because I was still running OS X 10.6.8 (Snow Leopard), and at least OS X 10.7 (Lion) was required. I tried Software Update, but that didn't help, since OS X 10.7 isn't just an upgrade, it's a new OS and you need to purchase a DVD (or image) and then install it over the current OS.
Given the fact that I'm scheduled to do a 3-day Delphi XE2 Essentials seminar next week in Stockholm, Sweden, followed by a guest appearance at the Delphi Developer Days in Amsterdam (again about iOS development), I was not really in the mood to try to put a new version of OS X on the Mac Mini (with the chance that everything would be broken, and I had no way to show both Mac OS X and iOS support next week).
Instead, I went to the official https://developer.apple.com/downloads site, logged in with my iOS Developer account, and tried to download the Xcode 4.3.1 for Lion xcode_4.3.1_for_lion.dmg file myself. Although it wouldn't install on OS X Snow Leopard, it did contain the required iOS 5.1 SDK (and iPhone simulator SDK) as well as the iOS device support files that I needed.
Once I had the 1,981,936,223 byte file downloaded (took a number of attempts, since my sessions kept getting a timeout after 980 MB), I mounted the file on my Mac Mini and then use the "Show Package Contents" option to drill down into the package.
Note that this is "at your own risk", but at least it felt better than having to install OS X 10.7 and Xcode 4.3.1 on my working Mac Mini.
Make sure the "old" Xcode is not running while you do this. With Xcode 4.2 installed in the /Developer directory, I copied the /Developer/Platforms/iPhoneOS.platform/Developer/SDKs directory from the Xcode 4.3.1 package (containing iPhoneOS5.1.sdk), as well as the /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs directory, also containing the iPhoneSimulator5.1.sdk directory, and finally from the /Developer/Platforms/iPhoneOS.platform/DeviceSupport directory the "5.1 (98176)" directory (the 4.2, 4.3 and 5.0 subdirectories were already part of my Xcode 4.2 installation).
I noticed a linked directory "Latest", pointing to the 5.1 (98176) in the package, and you can also link it to the 5.1 (98176) instead of the 5.0 (9A334) directory it was linking to. Right now, I have a long list of no less than 17 different iOS versions for device support. Including the 5.1, which was the main thing I cared about.
Now, starting Xcode 4.2 will show the iOS 5.1 as possible target, and it also immediately recognises my iPhone 4 (running iOS 5.1) again, as well as the iPad 2 still running iOS 5.0.1. And yes, I can deploy iOS applications both on the iPad and the iPhone, so I'm good to go for the iOS demos next week.
These steps, along with several screenshots, will be described in more details in the next edition of my Delphi XE2 iOS Development Essentials (due when I'm back from Stockholm), also covering some more Update #4 enhancements for native iOS development.
I must say I'm a bit disappointed (in Apple) that the iOS 5.1 SDK isn't available for download without Xcode 4.3.1 (and without the need for the OS X Lion operating system). From the few tests that I ran, it appears to work fine for my FireMonkey for iOS applications compiled with FPC 2.6 in Xcode 4.2, targeting the iOS 5.1 iPhone. Anyway, remember that these steps are on your own risk, but feel free to comment if you have other experiences...