I still have Snow Leopard. I have Xcode 4.2 for iOS development. This morning I upgraded my iPhone and iPad to iOS 5.1.
But Xcode 4.2 is not detecting my device for testing. I could not find the iOS 5.1 SDK image on Apple's developer site, for Xcode 4.2.
I don't want to do upgrade to Lion to get XCode 4.3 at this time.
Will I able to use Xcode 4.2 (on Snow Leopard) for iOS development now?
To get Xcode 4.2 on Snow Leopard to run code on a device running iOS 5.1 you can do this:
If you have another Mac running Lion and Xcode 4.3.1 you can copy the files from:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)
Place the copied files in the equivalent place on your Snow Leopard Mac: probably
/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Similarly copy the iOS 5.1 SDK files found in this directory:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
Also copy 'version.plist' from the Lion machine in the iPhoneOS.platform folder to the Snow Leopard machine.
Re-start Xcode on the Snow Leopard machine and re-connect the devices and it seems happy enough.
If you don't have access to a machine with Lion and Xcode 4.3.1:
You can get the files out of the 4.3.1 DMG
which can be downloaded from Apple here: Downloads for Apple Developers.
Mount the DMG, Show Package Contents on the Xcode icon and drill down to
/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Follow the steps above.
You might find it more convenient to use Apple's proprietary ditto
method (sudo ditto src dest
) in the terminal window to copy the folders.
Note,this hack will also work for latest iOS 6 SDK.