Install Simulator SDK 4.3 to Xcode 4.4 on Mountain Lion

落爺英雄遲暮 提交于 2019-11-26 21:50:56

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.

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.

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!