xcode 为旧版本的 Mac OS X 编译

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2857295/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:22:24  来源:igfitidea点击:

Compiling for older versions of Mac OS X

xcodemacossdkcompilation

提问by Tristan

I have recently started producing applications for the Mac, on my most recent release I got overwhelming suggestions to get the app working on OSX 10.5 as I'm working in and compiling for 10.6.

我最近开始为 Mac 开发应用程序,在我最近的版本中,我得到了大量建议,让我在 OSX 10.5 上运行应用程序并为 10.6 进行编译。

I tried looking for the 10.5 SDK but couldn't find it anywhere to download! How can I go about compiling my app for older versions of Mac OS X using Xcode 2.2 and developing in 10.6?

我尝试寻找 10.5 SDK,但找不到可以下载的任何地方!我如何使用 Xcode 2.2 为旧版本的 Mac OS X 编译我的应用程序并在 10.6 中开发?

EDIT: ------ I will mention I don't have the to option to select different SDKs as I don't have any others installed and my problem is more not being able to find where to get those sdks from? then actually not know how to go about compiling for the older sdks

编辑:------ 我会提到我没有选择不同的 SDK 的选项,因为我没有安装任何其他 SDK,我的问题更多的是无法找到从哪里获取这些 SDK?那么实际上不知道如何为旧的 sdks 进行编译

采纳答案by AriX

Redownload the entire Xcode Tools packages from http://developer.apple.com/mac/. Then, run the installer, and when you get to the screen that says "Standard Install", instead of pressing Continue, press Customize in the bottom left-hand corner. You should have the option to install MacOSX10.5.sdk as well as MacOSX10.4u.sdk.

http://developer.apple.com/mac/重新下载整个 Xcode 工具包。然后,运行安装程序,当您到达显示“标准安装”的屏幕时,不要按继续,而是按左下角的自定义。您应该可以选择安装 MacOSX10.5.sdk 和 MacOSX10.4u.sdk。

回答by Georg Fritzsche

This can be configured in the project or target settings (right-click -> Get Info):

这可以在项目或目标设置中进行配置(右键单击 -> 获取信息):

Build -> Base SDK.

构建 -> 基础 SDK。

回答by Alek

Downloading other SDKs didn't work fo me. What helped is just setting:

下载其他 SDK 对我不起作用。有帮助的只是设置:

Build Settings -> MACOSX_DEPLOYMENT_TARGET

to desired OSX version in Project Editor. It worked with the default SDK.

到项目编辑器中所需的 OSX 版本。它适用于默认的 SDK。

Xcode 10.3, Dev. OS: 10.14 (Mojave), Deployment OS: 10.13 (High Sierra)

Xcode 10.3,开发。操作系统:10.14 (Mojave),部署操作系统:10.13 (High Sierra)