How can I install iPhone Simulator 4.2 on Xcode 4.2?

Developer Information:

Version: 4.2 (4D199) Location: /Developer Applications: Xcode: 4.2 (828) Instruments: 4.2 (4233) Dashcode: 3.0.2 (336) SDKs: Mac OS X: 10.6: (10K549) 10.7: (11C63) iPhone OS: 5.0: (9A334) iPhone Simulator: 4.3: (8H7) 5.0: (9A334)

As you see, Xcode4.2 is installed and this supports iOS4.3, 5.0 simulator.
How can I test app for iOS4.2?
Should I install Xcode 3.x?

Thanks in advance.


Solution 1:

  • Download xcode_3.2.6_and_ios_sdk_4.3.dmg (note - you need a developer account to access this software. I have instead linked to an open-to-the-public Apple discussion that contains the direct download link
  • Mount the .dmg file
  • Inside the disk image there is an invisible "Packages" folder. To open it select "Go to folder..." command from Finder menu bar and digit the path "/Volumes/Xcode and iOS SDK/Packages/"
  • Now double-click "iPhoneSimulatorSDK4_2.pkg"
  • Click into the destination disk and a button "Select folder..." will be revealed
  • Click the above button and select your "Developer" folder
  • Install the package, and Restart Xcode.

This will install the Simulator 4.2 SDK (both iPad and iPhone) inside the folder "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/"

Now inside XCode 4.2 you can select this simulator from the menu.

Bye.

Solution 2:

The answer given above didn't quite work for me; I never got a select-folder button, and the 4.2 simulator ended up in /Platforms/iPhoneSimulator.platform/Developer/SDKs, which is not where the 4.2 and 5.0 simulators live; and though I restarted Xcode, no 4.2 simulator appeared there.

I manually moved it next to the others (in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs), using sudo mv in Terminal. Then I restarted Xcode again, but still no 4.2 simulator. At the moment, I'm stumped.

Solution 3:

If you have an iPhone OS 3.x device, and you plan to test on device, then you don't need to install Xcode 3 or Xcode 4.0 or Xcode 4.1 as Xcode 4.2 has an optional (look under Xcode 4.2 Preferences -> Downloads tab -> Components tab) install that you just need to download.

If you don't have an iPhone 0S 3.x device, and wants to use the simulator, you can install an earlier Xcode (that has the simulator you want) at a different path than the Xcode 4.2. Do not install both using the default path or at the same path as it may make your development environment unstable and "sudo /Library/uninstall-devtools" won't help then.

[Note to moderator] This question should be migrated to stackoverflow.com.

Solution 4:

its very simple

you have Xcode 4.2.1

open xcode > preferences> Downloads> (tab)

and you should have a list of the simulators to download and install

Enjoy