将旧版iOS SDK添加到Lion中的Xcode 4.1 [英] Adding Older iOS SDKs to Xcode 4.1 in Lion

查看:112
本文介绍了将旧版iOS SDK添加到Lion中的Xcode 4.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Lion和Xcode 4.1。如何添加较旧的SDK,以便在iPhone / iPad模拟器中构建和运行4.1或4.2? Xcode 4.1仅附带iOS 4.3 SDK。

I just installed Lion and Xcode 4.1. How do I add older SDKs so I can build and run in 4.1 or 4.2 in iPhone/iPad Simulator? Xcode 4.1 only comes with the iOS 4.3 SDK.

Lion是否有某种最低版本的SDK?

Does Lion have some sort of minimum SDK for builds?

谢谢,

推荐答案

实际上 可以添加较旧的SDK,只要你仍然可以使用旧版本的Xcode较旧的SDK。它有时也很有用:当你这样做时,你会发现在编译期间而不是在运行时可能使用的不受支持的常量和方法。以下是如何操作。

Actually it is possible to add older SDKs as long as you can still get your hands on an older version of Xcode with the older SDK. It's useful too sometimes: when you do this you get to find out about unsupported constants and methods you may be using during compile rather than at runtime. Here's how to do it.


  1. 使用较旧的SDK获取旧版Xcode。 Apple iOS开发人员中心目前列出了带有Xcode 3.2.6下载的4.3 SDK。

  1. Get hold of an older version of Xcode with the older SDK. The Apple iOS Dev Center currently lists the 4.3 SDK with the Xcode 3.2.6 download.

安装dmg并打开隐藏在dmg中的Packages文件夹终端:

Mount the dmg and open up the Packages folder hidden within the dmg via Terminal:

open / Volumes / Xcode \和\ iOS \ SDK / Packages /

open /Volumes/Xcode\ and\ iOS\ SDK/Packages/

双击所需SDK版本的pkg文件。我一直在寻找iPhoneSDK4_3.pkg,但除了4.3之外,还发现了与iPhoneSDK3_0.pkg一样旧的软件包。因此,如果您知道在哪里找到它(或者我没有),可能仍然可以将较旧的SDK与App Store下载打包。

Double click the pkg file for the SDK version you want. I was looking for iPhoneSDK4_3.pkg but, in addition to 4.3, found packages as old as iPhoneSDK3_0.pkg. So perhaps older SDKs may still be packaged with the App Store download if you know where to find it (I didn't).

让它安装在其中自己选择的文件夹,因为你无法强制它安装在Applications / Xcode.app / Contents / Developer(这是Developer文件夹现在的位置)

Let it install in it's own folder of choice since you won't be able to force it to install in Applications/Xcode.app/Contents/Developer (which is where the Developer folder is now)

您将在所选卷的Platforms文件夹中找到安装的软件包。将相关的SDK移动到Xcode.app中的Developer文件夹。你可能不得不使用sudo:

You'll find the package installed in the Platforms folder in the volume you chose. Move the relevant SDK over to the Developer folder within Xcode.app. You'll likely have to use sudo:

sudo mv /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/Applications/Xcode.app/Contents /Developer/Platforms/iPhoneOS.platform/Developer/SDKs /

sudo mv /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

重新启动Xcode,您应该会看到Base SDK选项中列出的新(旧)SDK 。 Yay!

Restart Xcode and you should see the new (old) SDK listed in your options for Base SDK. Yay!

截至2013年9月12日更新

如果您尝试添加的旧版SDK捆绑在Xcode 4.3或更高版本中,添加SDK就像从开发中心链接下载Xcode一样简单,即寻找旧版本的Xcode ? (目前指向此处),安装dmg,然后复制相关文件结束。

If the "older SDK" you're trying to add comes bundled in Xcode 4.3 or later, adding the SDK is as simple as downloading Xcode from dev center link that says "Looking for an older version of Xcode?" (currently points here), mounting the dmg, then copying the relevant files over.

在终端中,您可以执行以下操作(编辑相应的SDK版本号):

In terminal, you'd do something like this (edit for the appropriate SDK version number):

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 4.3,较旧的步骤仍然相关。

For SDKs from versions of Xcode prior to 4.3, the older steps are still relevant.

我发现这恰好适用于使Xcode 5 GM编译带有旧iOS 6 UI的构建,即使部署在iOS 7设备。有助于修复错误,等待UI重新设计。也就是说,必须有一种更简单的方法来在iOS 7设备上获得iOS 6用户界面。

I found this happens to work for getting the Xcode 5 GM to compile builds that carry the old iOS 6 UI even when deployed on iOS 7 devices. Useful for fixing bugs pending a UI redesign. That said, there's got to be an easier way to get the iOS 6 UI on an iOS 7 device.

这篇关于将旧版iOS SDK添加到Lion中的Xcode 4.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆