ios 在 Mountain Lion 上将 Simulator SDK 4.3 安装到 Xcode 4.4
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11651773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install Simulator SDK 4.3 to Xcode 4.4 on Mountain Lion
提问by Samblg
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模拟器找不到软件开发工具包。
The sdk may need to be reinstalled, which means it couldn't run! What's wrong with xcode 4.4 GM?
sdk 可能需要重新安装,这意味着它无法运行!xcode 4.4 GM 有什么问题?
Are there any ideas about how to solve this kind of problem?
有没有关于如何解决这类问题的想法?
回答by Kemenaran
I've looked into it, and this is a deliberate behavior from Apple.
我已经调查过了,这是 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. And I couldn't manage a manual download of the 4.3 Simulator DMG: the ADG website throws a "Session expired" error.
我试图编辑该文件,但只要 Xcode 打开,它就会被另一个版本替换。而且我无法管理 4.3 Simulator DMG 的手动下载:ADG 网站抛出“会话已过期”错误。
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.
看起来 Apple 对 4.3 模拟器有问题,并决定禁用它。对于必须支持此版本的人来说,这很糟糕。
回答by Hisham
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.
我向 Apple 提交了 DTS,并与他们确认 Mountain Lion 不支持 iOS4 模拟器。他们建议在真实设备上进行测试。
回答by perpenso
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.
看起来像是 Lion vs Mountain Lion 的问题。
我今天更新了几台机器到 Xcode 4.4。两个较旧的 Lion 系统提供在 xcode|preferences|downloads 下安装 iOS 4.3 和 5.0 模拟器。较新的 Mountain Lion 系统仅提供 iOS 5.0 模拟器。
回答by Bo A
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.
我也遇到过这种烦人的情况。最近,我设法增加一个编译时检查,检查老版本的SDK的API。不幸的是,您无法通过模拟器使用旧版本对其进行测试,但它仍然存在。
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.
我首先必须获得我想要获得的旧版 Simulator SDK。我可以很容易地通过下载年长的Xcode得到这3其中包括所需要的SDK(不是4)版本。带有 iOS SDK 4.3 的 Xcode 3.2.6在此处链接。
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 simulatorSDK, 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.
我接下来必须安装 SDK。这不是太难,所以我不会在这里解释太多。但是 SDK 存储在Packages
文件夹中。该文件夹在早期 Xcode 3 版本中清晰可见,但在更高版本中隐藏(如 Xcode 3.2.6)。无论如何,您都可以通过终端轻松打开它。记住要安装模拟器SDK,而不是常规的。此外,在 Xcode 4.3 中Developer
文件夹移动到 Xcode.app 中的更改后,我必须将 SDK 安装到 tmp 文件夹中,然后自己将 SDK 移动到 Xcode.app 中。如果我打开它,我将需要重新启动 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. 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
.
之后,我debug
在我的项目中复制了配置并将其命名为类似iOS 4.3 API Check
或类似的名称 - 并不重要。然后我将这个新配置的 Base SDK 更改为我安装的旧 SDK。我安装的 SDK 没有列出,所以我必须选择other
并输入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.
最后,当我需要检查旧版本的 SDK 时,我将Run <appname>.app
项目方案中的配置更改为我的iOS 4.3 API Check
配置。我们开始了,针对 iOS 4.3 的编译时检查。
回答by Yariv Nissim
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.
升级到 ML 后,我可以选择下载 iOS 4.3 Simulator。然而它没有用!我在调试时收到错误。当我尝试手动切换模拟器版本时,它卡住了。
If I knew, I would have probably waited for a solution, instead of upgrading.
如果我知道,我可能会等待解决方案,而不是升级。