Testing multiple iOS versions in Simulator - iphone

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

Related

iPhone with iOS 6 and Xcode 4.2 issue

I have upgraded my iPhone to iOS 6, however I am currently on Xcode 4.2 (on Snow Leopard). Now I am getting this error message:
The version of iOS on “xxx xxx” does not match any of the versions of
iOS supported for development with this installation of the iOS SDK.
Please restore the device to a version of the iOS listed below, or
update to the latest version of the iOS.
Is it possible to restore my iPhone to older version say 5.1 or some how make my Xcode to support/recognize iOS6?
I followed the following steps, to resolve my issue by making Xcode to support iOS 6:
1.First download Xcode 4.5 .dmg file from Here (You would need developer account).
2.Then mount this image and use "Show Package Contents" from context menu.
3.Then copy the following folder
Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.1
(10A403)
to your mac's following folder (This path may differ from mac to mac based on its version. On Snow Leopard you may find the Developer folder in Finder under PLACES section, and probably on Lion, you have to right click the Xcode.app and have to use Show Package Contents):
Developer/Platforms/iPhoneOS.platform/DeviceSupport
4.Similarly copy the iOS 6 SDK folder from following directory:
Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
to your mac's following folder
Developer/Platforms/iPhoneOS.platform/Developer/SDKs
5.Also copy version.plist from Contents/Developer/Platforms/iPhoneOS.platform folder to your mac's Developer/Platforms/iPhoneOS.platform folder.
6.Re-start Xcode and re-connect the device(s).
Bingo !! now Xcode supports recognizes iOS6 device(s) and even I am able to run and debug my app (built for older SDKs) on my iPhone with iOS6 (I am not sure about iPhone 6.0 simulator though).
However, answer to How to restore iPhone to older version say 5.1 is still pending.
You cant debug iO6 device in Xcode 4.2. iO6 device debugs only in Xcode 4.5 (latest one). And most importent for installing Xcode 4.5, in your machine must have at least Lion Operating System.For efficiently debugging of iOS device, You must upgrade your OS.
I had the exactly same problem !
Downgrading iOS 6 in your iPhone is not officially supported by Apple anymore :
https://discussions.apple.com/thread/4533316?start=0&tstart=0
What works for me was to install Lion in an external HD USB, upgrade Xcode to the latest version and upgrade the Provisioning Profiles in my Apple Developer account for this environment.
Upgrade to Xcode 4.5 (and OSX mountain lion). No previous version of Xcode supports iOS 6. You can also check if you can restore your phone using a previous version of iOS by getting the .ipsw file and option-clicking on "restore" button when selecting your device on iTunes.

Are Xcode 4 and iOS SDK 4.3 compatible with Snow Leopard?

Currently I am using Xcode 3 and iOS SDK 4.2 on Snow Leopard. I am planning to download and install Xcode 4 and iOS SDK 4.3.
I would like to know if Xcode 4 and iOS SDK 4.3 are compatible with Snow Leopard.
Yes..You will have separate .dmg available for download when you visit iOS developer center X-Code download link.
Please do note that the X-Code 4.2 will have iOS 5 simulator and library only. If you want lower version simulator and library with X-Code just goto X.Code->Prefrences-> Downloads Tab. In downloads tab you'll have two tabs:
1) Components - Here you will have option to download iOS 4.3 simulator(~600 Mb), iOS 4.0-4.1(~670 MB) Device debugging support, iOS 3.0-3.2.2(686.3 MB) Device debugging support.
2) Documentation- Yoy will have option to download iOS 5.0,XCode 4.2 Developer libaray,Mac OSX 10.7 Core Library.
Install the components which ever you need and there you go..
Hope that helps.
There's a specific version of Xcode 4.2 (and likely earlier versions) that can be used on Snow Leopard. That's the version I use on my iMac. Note that you can use 4.2 w/iOS5 SDK and still deploy on older devices (and even download the 4.3 simulator) in case you cannot find Xcode 4.
However you cannot use (download) the one from the AppStore which is Lion-specific. To find the Snow Leopard specific version log into Apple's developers portal and you'll see separate links for SL and Lion.
Yes, it's compatible. Download the XCode 4.2 .dmg from the iOS dev program portal, which includes the iOS 5.0 SDK.
http://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.2_with_ios_5_sdk/xcode_4.2_and_ios_5_sdk_for_snow_leopard.dmg
Yes, but only if you have the correct download from Apple.
There are currently 2 separate dmg downloads for the SDK and Xcode installer from the enrolled Developer web site, one for Lion and one for Snow Leopard. The download for Lion is only compatible with Lion. The download for Snow Leopard is only compatible with Snow Leopard. The installer from the App store might be for Lion only, so you may have to sign up for the developer program to get the other installer.
Apple usually removes (or hides) downloads for previous versions of the SDK, so if you didn't download the correct installer dmg (with the SDK for iOS 4.x) for the Mac OS of interest in time, you won't have a compatible installer.

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)

How to test different iOSes in simulator

I am finally done with my app. Testing begins! It works great in the most recent 4.3.2 but when I change the device version in simulator to something lesser and launch my app it automatically reverts to the newest 4.3.2 version. How do I overcome this and ensure my app runs on all iphones?
Thanks!
EDIT:
Figured it out! Set the deployment target in Project and Target to the lowest iOS. Next to the Run and Stop buttons, there is a drop down list "Scheme" select the deployment target. It should launch the simulator with the iOS version you select!
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).
Regards
Karan Shah

XCode 4 and iOS 4.2.1

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.