简体   繁体   English

在Mountain Lion上将Simulator SDK 4.3安装到Xcode 4.4

[英]Install Simulator SDK 4.3 to Xcode 4.4 on Mountain Lion

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. 我想在山狮(os x 10.8)的xcode 4.4中安装SDK 4.3,但是当我从xcode 4.1安装4.3 sdk程序包并从xcode 4.4启动模拟器时,模拟器只是告诉我ios模拟器找不到sdk。

The sdk may need to be reinstalled, which means it couldn't run! sdk可能需要重新安装,这意味着它无法运行! What's wrong with xcode 4.4 GM? xcode 4.4 GM有什么问题?

Are there any ideas about how to solve this kind of problem? 是否有解决此类问题的想法?

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: 这是Xcode下载位置的缓存的(已编辑)摘要:

~/Library/Caches/com.apple.dt.Xcode/Downloads/eded78df8bfabaf6560841d10cf8e53766f74f28.dvtdownloadableindex 〜/ 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. 请注意显式的“ ActivationPredicate:$ MAC_OS_X_VERSION <10.8.0”设置,该设置在其他模拟器程序包中不存在。

I tried to edit the file, but it is replaced by another version as soon as Xcode opens. 我试图编辑该文件,但是Xcode打开后,它将被另一个版本替换。 And I couldn't manage a manual download of the 4.3 Simulator DMG: the ADG website throws a "Session expired" error. 而且我无法手动下载4.3 Simulator DMG:ADG网站引发“会话过期”错误。

Looks like Apple had issues with the 4.3 simulator, and decided to disable it. 看起来苹果在4.3模拟器上遇到了问题,因此决定将其禁用。 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. 我向Apple提交了DTS,并向他们确认了Mountain Lion不支持iOS4模拟器。 They recommend to test on a real device. 他们建议在真实设备上进行测试。

It looks like a Lion vs Mountain Lion issue. 看起来像Lion vs Mountain Lion的问题。
I updated several machines to Xcode 4.4 today. 我今天将几台计算机更新为Xcode 4.4。 The two older Lion systems offer to install the iOS 4.3 and 5.0 simulators under xcode|preferences|downloads. 两个较旧的Lion系统提供了在xcode | preferences | downloads下安装iOS 4.3和5.0模拟器的功能。 The newer Mountain Lion system only offers the iOS 5.0 simulator. 较新的Mountain Lion系统仅提供iOS 5.0模拟器。

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. 最近,我设法添加了一个编译时检查,以对照旧版本的SDK检查API。 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. 我首先必须获得想要获得的旧版Simulator SDK。 I could easily get this by downloading older Xcode 3 (not 4) versions which included the SDK needed. 我可以通过下载包含所需SDK的旧版Xcode 3 (而非4)来轻松获得此功能。 Xcode 3.2.6 with iOS SDK 4.3 is linked here . Xcode中3.2.6与iOS SDK 4.3链接在这里

I next had to install the SDK. 接下来,我必须安装SDK。 This wasn't too hard, so I won't explain much here. 这不太难,所以我在这里不做过多解释。 But the SDKs are stored in the Packages folder. 但是,SDK存储在Packages文件夹中。 This folder is clearly visible in earlier Xcode 3 versions but is hidden in later versions (like Xcode 3.2.6). 该文件夹在早期的Xcode 3版本中清晰可见,但在更高的版本(如Xcode 3.2.6)中隐藏。 You can easily open it anyway through Terminal. 无论如何,您都可以通过Terminal轻松打开它。 Remember to install the simulator SDK, not the regular one. 记住要安装模拟器 SDK,而不是常规模拟器 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. 同样,在Xcode 4.3中将Developer文件夹移到Xcode.app内之后,我不得不将SDK安装到tmp文件夹中,然后将SDK自己移到Xcode.app中。 I would then need to restart Xcode if I had it open. 如果我打开了Xcode,则需要重新启动它。

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. 之后,我在项目中复制了debug配置,并将其命名为iOS 4.3 API Check类的名称-并不重要。 Then I changed the Base SDK of this new configuration to the old SDK which I installed. 然后,我将此新配置的基本SDK更改为安装的旧SDK。 The SDK I installed was not listed though so I had to select other and entered iphonesimulator4.3 . 我安装的SDK未列出,因此我必须选择other SDK并输入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. 最后,当我需要检查旧版本的SDK时,我将项目方案中Run <appname>.app的配置更改为iOS 4.3 API Check配置。 And there we go, a compile-time check against iOS 4.3. 接下来,我们针对iOS 4.3进行了编译时检查。

After upgrading to ML, I had an option to download iOS 4.3 Simulator. 升级到ML后,我可以选择下载iOS 4.3模拟器。 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. 如果我知道,我可能会等待解决方案,而不是升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM