Xcode 5有一个首选项窗格,允许一个人下载iPhone 6.1模拟器,但我找不到一个地方,它允许下载iOS 6 SDK,因此不可能将活动SDK设置为iOS 6时,用Xcode 5开发。是否存在允许Xcode 5安装iOS 6 SDK的解决方案?

编辑:

既然Xcode 5已经普遍可用,并且允许你下载以前版本的SDK,那么变通方法应该不再是必要的了。


当前回答

Download Xcode 4.6.x from the Apple Dev Center: https://developer.apple.com/downloads/index.action Create a folder called Xcode4 within the Applications folder and drag-n-drop the downloaded dmg there. Open a terminal window $sudo cp -R /Applications/Xcode4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ You will be prompt to enter a password since you're inside a system folder Open Xcode 5 and you should now see both SDKs

其他回答

当我更新到xcode 5时,我也遇到了同样的问题,它删除了旧的sdk。但是我从另一台计算机上获取了旧SDK的副本,你可以从下面的链接下载。

http://www.4shared.com/zip/NlPgsxz6/iPhoneOS61sdk.html (www.4shared.com测试账号test@yopmail.com/test)

有两种方法。

1)解压并粘贴到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS。平台/开发者/ sdk &重新启动xcode。

但如果你更新Xcode,这可能会被Xcode删除。

2)另一种方法是解压并粘贴到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS。平台/开发者/SDK并在这里创建一个符号链接,这样即使你更新了Xcode, SDK也会保持不变。

我做的另一个改变,构建设置>架构>标准(不是64),所以列出部署目标的所有版本

如果只是想更改部署目标,则不需要下载压缩包。

以下是一些截图。

Download Xcode 4.6.x from the Apple Dev Center: https://developer.apple.com/downloads/index.action Create a folder called Xcode4 within the Applications folder and drag-n-drop the downloaded dmg there. Open a terminal window $sudo cp -R /Applications/Xcode4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ You will be prompt to enter a password since you're inside a system folder Open Xcode 5 and you should now see both SDKs

对我来说最简单的解决方法:

Locate an older SDK like for example "iPhoneOS6.1 sdk" in an older version of xcode for example. If you haven't, you can downlad it from Apple Developer server at this address: https://developer.apple.com/downloads/index.action?name=Xcode When you open the xcode.dmg you can find it by opening the Xcode.app (right click and "show contents") and go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1 sdk Simple Copy the folder iPhoneOS6.X sdk and paste it in your xcode.app right click on your xcode.app in Applications folder. Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ Just paste here.

关闭你的xcode应用程序,重新打开它。

要在模拟器上测试iOS 6中的应用程序: -在你的活动场景中选择iOS 6.0即可。

要在iOS 6中构建应用程序,那么你的应用程序的设计将是iOS 7 iPhone上的旧设计: —在“Targets - Base SDK”中选择“iOS6.1”

请注意:当你在你的目标中改变基础SDK时,iOS 7.0将不再可用来构建模拟器!

这里的其他答案也是正确的,但我发现以下步骤是最简单的:

只需从开发中心链接下载Xcode 4.6.3,上面写着“寻找Xcode的旧版本?”(目前点这里)和安装dmg。

然后在终端,复制SDK文件:

cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

最后,重新启动Xcode,你就完成了。

您可以下载旧的SDK并将其安装进去

xcode /内容/开发/平台/ iPhoneOS.platform /开发/ sdk /

文件夹中。注销+登录只是为了确保更改生效,你应该在你的新XCode中看到旧的SDK