Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...
Title:

iOS 5.1 device upgrade gotchas

Author: Bob Swart
Posted: 3/20/2012 1:58:31 PM (GMT+1)
Content:

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...

Back  


7 Comments

AuthorPostedComments
Bob Swart 12/03/20 14:02:49I guess a more catching title could have been: installing iOS 5.1 SDK in Xcode 4.2 on Mac OS X Snow Leopard ;-)
A. Bouchez 12/03/20 14:19:40Nice workaround. Thanks.
Jens Fudge 12/03/20 14:43:50Interesting.. I would've bought myself another iPhone (or depending on the demo's just an iPod Touch), and just not update the iOS firmware. Mind you, I did upgrade to Lion on my Mac Pro when it came out, and the upgrade went very smoothly (in my case at least).
Marco Erdmann 12/03/20 15:38:10There might be more gotchas ahead. The Delphi XE2 Update 4 release notes state that the FireMonkey iOS Tools installer fails with Xcode 4.3 installed. Apple is well known for dropping support for older operating systems extremely fast. At least you can install Xcode 4.2 on Lion (for now) but who knows what the next Lion update brings along.
Harry Stahl 12/03/27 23:33:24Really great thanks. I bought today to Iphone 4S and made the update to 5.1 and had then the big mess. But your trick gave me freedom with my Delphi / Firemonkey / xCode / snow leopard installation...
Paul Keller 12/04/29 00:25:39Bob, I can't tell you how wonderful this article is. I'm unable to upgrade to Lion at the moment because I have some essential software that isn't compatible with Lion and after upgrading my iPhone to 5.1 I've been unable to use it as a development device and thanks to you I no longer have to worry about it. Thanks so much.
Ibrahim 12/05/19 18:45:19NOTE: They've renamed iPhone Simulator to iOS Simulator so this tnmireal command doesn't work anymore. You can still go into the folder manually (the path is provided in that tnmireal command) and just right click and select Make Alias and put the alias/shortcut wherever you want (like in your Applications folder).


New Comment (max. 2048 characters, no HTML):

Name:
Comment:



This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - www.drbob42.com). All Rights Reserved.