58

I want to install SDK 4.3 in xcode 4.4 on mountain lion (os x 10.8), but when I installed the 4.3 sdk package from xcode 4.1 and launched the simulator from xcode 4.4, the simulator just told me that the ios simulator could not find the sdk.

The sdk may need to be reinstalled, which means it couldn't run! What's wrong with xcode 4.4 GM?

Are there any ideas about how to solve this kind of problem?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Samblg
  • 977
  • 2
  • 12
  • 15
  • I could only use iPhone simulator 5.1 to run app compiled by SDK 4.3... It's ridiculers, why mountain lion GM couldn't run xcode 4.3?~!!!!!!!! – Samblg Jul 25 '12 at 14:20
  • Nop, Xcode 4.4 drops iOS 4.3 simulator, only leaves debugging support for 4.0 - 4.1 devices. – Jack Gao Jul 25 '12 at 16:17
  • Check my answer
    http://stackoverflow.com/questions/16353099/run-app-using-xcode-4-6-in-ios-4-3-simulator/16353379#16353379
    – Piyush Dubey Jun 17 '13 at 06:18

5 Answers5

21

I've looked into it, and this is a deliberate behavior from Apple.

Here is an (edited) extract of the cache for Xcode download locations:

~/Library/Caches/com.apple.dt.Xcode/Downloads/eded78df8bfabaf6560841d10cf8e53766f74f28.dvtdownloadableindex

<dict>
    <key>source</key>
    <string>http://adcdownload.apple.com/ios/ios_simulator__resigned/ios_43_simulator.dmg</string>
    <key>identifier</key>
    <string>Xcode.SDK.iPhoneSimulator.4.3</string>
    <key>name</key>
    <string>iOS 4.3 Simulator</string>
    <key>userInfo</key>
    <dict>
        <key>InstalledIfAllPathsArePresent</key>
        <array>
            <string>$(DEVELOPER)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk</string>
        </array>
        <key>ActivationPredicate</key>
        <string>$MAC_OS_X_VERSION < "10.8.0"</string>
    </dict>
</dict>

Note the explicit "ActivationPredicate: $MAC_OS_X_VERSION < 10.8.0" setting, which is not present on other simulator packages.

I tried to edit the file, but it is replaced by another version as soon as Xcode opens. And I couldn't manage a manual download of the 4.3 Simulator DMG: the ADG website throws a "Session expired" error.

Looks like Apple had issues with the 4.3 simulator, and decided to disable it. Which sucks for people that have to support this version.

Kemenaran
  • 1,421
  • 12
  • 11
  • 2
    you can prevent the file from being replaced when Xcode starts by doing 'chgflags -vv uchg *.dvtdownloadableindex' (make the file editable again by changing uchg to nouchg, the -vv just sets verbose on so you can see the change). However, Xcode seems still seems to ignore the 4.3 simulator... – Dave Wood Jul 27 '12 at 08:12
  • For me this opened in BBEdit, but not in Vim. – Nick Mar 20 '13 at 21:34
16

I filed a DTS with Apple and confirmed with them that iOS4 simulator is not supported on Mountain Lion. They recommend to test on a real device.

Hisham
  • 1,305
  • 2
  • 15
  • 25
  • Thanks. I havn't had luck with my testdevice either, because Xcode (4.5) didn't find it. I guess I'll test on a backup partition or a virtual machine. – brainray Sep 24 '12 at 15:59
  • Careful with your backup partition. Running an update on xcode via the Appstore updated Xcode (4.4) on the the Lion backup partition, not the Xcode on the Mountain Lion partition. I ended up by setting `chmod 000 /Aplication/xcode.app` on the backup during updates. – Olaf Sep 26 '12 at 07:14
  • 1
    @brainray Xcode 4.5 has completely deprecated iOS 4.2.1 and earlier operating systems, as well as any device that uses armv6 architecture (iPhone 2G, iPhone 3G, and first two generations of iPod Touch). This is unrelated to support for iPhone Simulator. So -- keep Xcode 4.4 around. – Ivan Vučica Sep 26 '12 at 11:57
  • @Olaf: thanks, yes I'm aware of this. I keep the backups disconnected, but thanks for the warning. – brainray Sep 26 '12 at 12:45
  • they do not support 4.3 on mountain lion and they do not let me update my ipod from 4.2 to 4.3 how can i test it on real device under circumtances ? – Ilker Baltaci Oct 12 '12 at 08:12
10

It looks like a Lion vs Mountain Lion issue.
I updated several machines to Xcode 4.4 today. The two older Lion systems offer to install the iOS 4.3 and 5.0 simulators under xcode|preferences|downloads. The newer Mountain Lion system only offers the iOS 5.0 simulator.

perpenso
  • 369
  • 1
  • 5
  • 3
    I see this too - just updated to XCode 4.4 on Lion, and the iOS 4.3 sim is still available to download under Preferences->Downloads. – jtomson Jul 26 '12 at 17:11
9

I've had this annoying situation too. Recently, I managed to add a compile-time check for checking APIs against older versions of the SDK. Unfortunately, you can't test it with the older version through the simulator but it's still something.

So here's what I did:

I first had to get the older Simulator SDK I wanted to get. I could easily get this by downloading older Xcode 3 (not 4) versions which included the SDK needed. Xcode 3.2.6 with iOS SDK 4.3 is linked here.

I next had to install the SDK. This wasn't too hard, so I won't explain much here. But the SDKs are stored in the Packages folder. This folder is clearly visible in earlier Xcode 3 versions but is hidden in later versions (like Xcode 3.2.6). You can easily open it anyway through Terminal. Remember to install the simulator SDK, not the regular one. Also, after the change in Xcode 4.3 where the Developer folder moved to within Xcode.app, I had to install the SDK into a tmp folder and move the SDK into Xcode.app myself. I would then need to restart Xcode if I had it open.

After that, I duplicated the debug configuration in my project and named it something like iOS 4.3 API Check or something like that - doesn't really matter. Then I changed the Base SDK of this new configuration to the old SDK which I installed. The SDK I installed was not listed though so I had to select other and entered iphonesimulator4.3.

Finally, when I needed to check against older versions of the SDK, I changed the configuration for the Run <appname>.app in my project scheme to my iOS 4.3 API Check configuration. And there we go, a compile-time check against iOS 4.3.

Bo A
  • 3,144
  • 2
  • 33
  • 49
  • 3
    To easily gei into the Packages folder hit Command-Shift-G while in a Finder window & enter "/Volumes/Xcode and iOS SDK/Packages". – Pedro Aug 08 '12 at 04:02
  • 1
    The target location for moving the newly installed SDK to is... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/De‌​veloper/SDKs – Pedro Aug 08 '12 at 04:03
1

After upgrading to ML, I had an option to download iOS 4.3 Simulator. However it did not work! I received an error while debugging. When I tried to switch the simulator version manually, it got stuck.

If I knew, I would have probably waited for a solution, instead of upgrading.

Yariv Nissim
  • 13,273
  • 1
  • 38
  • 44
  • 2
    I updated to Xcode 4.4 as well before upgrading to ML. I definitely have iOS 4.3 Simulator. But now that I'm on ML, I don't see it available for download anymore. However, I can still try to simulate an app in 4.3 Simulator. And by "try" I meant to say that it won't run. The SimulatorBridge process will choke and chew up all CPU time, followed by an error message: "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." – XCool Jul 29 '12 at 12:32
  • Is there an official statement from apple to this issue? – Daniel Aug 08 '12 at 07:12