是否可以在 Xcode 6 上安装 iOS 7 SDK?

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

Is it possible to install iOS 7 SDK on Xcode 6?

xcodeios7xcode6

提问by Pavan

I have Xcode 6 installed but realise that I am only able to develop for iOS8. I am aware that this beta development kit is meant for the development of the iOS 8 beta release but I am in a position where I don't have the time yet to develop for it but wish to take advantage of some of Xcode's new features while I am developing for my current iOS 7 apps.

我安装了 Xcode 6,但意识到我只能为 iOS8 进行开发。我知道这个 beta 开发工具包是为开发 iOS 8 beta 版本而设计的,但我现在还没有时间开发它,但希望利用 Xcode 的一些新功能,同时我正在为我当前的 iOS 7 应用程序开发。

What can I do to get the iOS 7 SDK installed on xcode 6?

我该怎么做才能在 xcode 6 上安装 iOS 7 SDK?

采纳答案by Ziewvater

Seems like if you symlink the relevant SDK from a previous installation of Xcode to the Xcode 6 Beta directory, Xcode 6 will be able to use it. Assuming you still have Xcode 5.1.1 on your machine, try the following in terminal:

似乎如果您将先前安装的 Xcode 中的相关 SDK 符号链接到 Xcode 6 Beta 目录,Xcode 6 将能够使用它。假设您的机器上仍有 Xcode 5.1.1,请在终端中尝试以下操作:

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk

This should link the iOS 7 SDK for iPhone (not sim), allowing you to select iOS 7 as the Base SDK in Xcode 6 Beta. If you want to do this for the simulator, replace iPhoneOS.platformwith iPhoneSimulator.platform.

这应该链接 iOS 7 SDK for iPhone(不是 sim),允许您选择 iOS 7 作为 Xcode 6 Beta 中的基础 SDK。如果要为模拟器执行此操作,请替换iPhoneOS.platformiPhoneSimulator.platform.

NOTE:Just because you have the iOS 7 SDK now doesn't mean it'll build. I'm personally having trouble with the fact that Xcode 6 Beta is using the Apple LLVM 6.0 compiler, which apparently isn't compatible with some of the stuff I'm trying to build.

注意:仅仅因为您现在拥有 iOS 7 SDK 并不意味着它会构建。我个人对 Xcode 6 Beta 使用 Apple LLVM 6.0 编译器这一事实感到困扰,这显然与我正在尝试构建的某些东西不兼容。

ref: https://stackoverflow.com/a/11424966/2383003

参考:https: //stackoverflow.com/a/11424966/2383003

回答by Joe M

Just posting so that someone might find it useful: I wanted to debug my app in iPhone running iOS 7.1, in XCode 6.0.1. The previous iOS version was not being listed in the settings page, to choose as base SDK/deployment target. (I'm using OS X 10.10 Yosemite). I installed both XCode 6.0.1 and Xcode 5.0.1 and copied

只是发布以便有人可能会发现它有用:我想在运行 iOS 7.1 的 iPhone 中调试我的应用程序,在 XCode 6.0.1 中。之前的 iOS 版本未列在设置页面中,以选择作为基础 SDK/部署目标。(我使用的是 OS X 10.10 Yosemite)。我安装了 XCode 6.0.1 和 Xcode 5.0.1 并复制

/Application/XCode501.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk

/Application/XCode501.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk

to

/Application/XCode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

/Application/XCode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

Now I'm able to run iOS 7 apps from XCode 6.0.1.

现在我可以从 XCode 6.0.1 运行 iOS 7 应用程序。

回答by Benjamin Dobell

Just repeating Christian's comment (on Ziewvater's answer) so it's more prominent:

只是重复 Christian 的评论(关于 Ziewvater 的回答),所以它更加突出:

What's strange is the fact that after adding the symbolic link to my Xcode folder, I see my device twice with the exact name and with some infos (iOS build number, model, device identifier) in the target selector in the upper left corner of Xcode. Depending on which of the both entries I chose, my app works fine or not, no matter which BASE SDK I chose. ??! Anybody experiencing the same?

奇怪的是,在将符号链接添加到我的 Xcode 文件夹后,我在 Xcode 左上角的目标选择器中看到我的设备两次,其中包含确切的名称和一些信息(iOS 版本号、型号、设备标识符) . 根据我选择的两个条目中的哪一个,无论我选择哪个 BASE SDK,我的应用程序都可以正常工作。??!有人遇到同样的情况吗?

This is exactly my experience also! Me and my team were tearing our hair out trying to understand why some builds seemed to be working and others were not.

这也正是我的经历!我和我的团队正在努力理解为什么有些构建似乎有效,而另一些却没有。

It looks like Apple must be ignoring the base SDK (or target... or something) when you pick the wrong device from the list.

当您从列表中选择错误的设备时,Apple 似乎必须忽略基本 SDK(或目标...或其他东西)。

回答by Fernando Mazzon

I changed the deployment target just fine and installed on my iOS7 iPhone 4s all the same. You can do all your development this way and then use 5.1.1 to make your relevant builds. I wouldn't advice to build apps for production in this beta environment even if you could.

我更改了部署目标并安装在我的 iOS7 iPhone 4s 上。您可以通过这种方式进行所有开发,然后使用 5.1.1 进行相关构建。即使可以,我也不建议在此 Beta 环境中构建用于生产的应用程序。

回答by user3441734

in Xcode 6.1.1 (Window -> Preferences - Downloads) you can install iOS 7.1 simulator. unfortunately it doesn't install iOS 7.1 SKD. if you set deployment target to 7.1 all builds without any trouble. be worry!!!! it is up to you to check the compatibility with 7.1 (SDK is still 8.1). so or so, all runtime trouble should be seen in simulator. i use this approach to build for my iPhone 4 in swift, where iOS 7.1.2 is the last available. (simply don't use any classes available only for newer devices :-))

在 Xcode 6.1.1(窗口 -> 首选项 - 下载)中,您可以安装 iOS 7.1 模拟器。不幸的是,它没有安装 iOS 7.1 SKD。如果您将部署目标设置为 7.1,则所有构建都没有任何问题。放心!!!!由您来检查与 7.1 的兼容性(SDK 仍然是 8.1)。左右,所有运行时问题都应该在模拟器中看到。我使用这种方法在 swift 中为我的 iPhone 4 构建,其中 iOS 7.1.2 是最后可用的。(只是不要使用任何仅适用于较新设备的类:-))