在 iOS 10 上使用 Xcode 7

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

Use Xcode 7 with iOS 10

iosxcode

提问by Fanruten

I want to use Xcode 7 with iOS 10.

我想在 iOS 10 中使用 Xcode 7。

As I understand, working with iOS 10 beta requires Xcode 8 beta, so I should upgrade my Xcode. However, my code can't be built by the new compiler, so I want to stay with Xcode 7.

据我了解,使用 iOS 10 beta 需要 Xcode 8 beta,所以我应该升级我的 Xcode。但是,我的代码无法由新编译器构建,所以我想继续使用 Xcode 7。

How can I achieve that?

我怎样才能做到这一点?

回答by Fanruten

You need use DeveloperDiskImage from Xcode 8 Beta. For this extract Xcode 8 Beta app and copy DeveloperDiskImage for iOS 10 to your Xcode folder.

您需要使用 Xcode 8 Beta 中的 DeveloperDiskImage。对于此提取 Xcode 8 Beta 应用程序,并将适用于 iOS 10 的 DeveloperDiskImage 复制到您的 Xcode 文件夹中。

Suppose you extract Xcode to Downloads/Xcode-beta.app

假设您将 Xcode 解压到 Downloads/Xcode-beta.app

cp -r /Users/fanruten/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A345\) /Applications/Xcode_7.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

After copy DeveloperDiskImage you should start Xcode and connect iOS device to your mac.

复制 DeveloperDiskImage 后,您应该启动 Xcode 并将 iOS 设备连接到您的 Mac。

Edit:
With a standard Xcode install one can create a soft link:

编辑:
使用标准的 Xcode 安装可以创建一个软链接:

sudo ln -s \
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5309d\) \
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0

回答by Edison

You can use any SDK on an older build of Xcode simply by copying and pasting the folder of the OS you need. Also you obviously cannot have two apps with the same name so just rename them to Xcode 7 and Xcode 8.

您只需复制并粘贴所需操作系统的文件夹,即可在较旧版本的 Xcode 上使用任何 SDK。此外,您显然不能有两个同名的应用程序,因此只需将它们重命名为 Xcode 7 和 Xcode 8。

right-click/ ctrl-clickthe Xcode 8 application icon to show the package contents and navigate to this location and copy the iOS 10.0 or WatchOS 3.0 folder etc.

右键单击/按住ctrl 单击Xcode 8 应用程序图标以显示包内容并导航到此位置并复制 iOS 10.0 或 WatchOS 3.0 文件夹等。

/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport /Applications/Xcode8.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport

/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport /Applications/Xcode8.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport

enter image description here

在此处输入图片说明

Then navigate to the same location in Xcode 7 and paste the folder.

然后导航到 Xcode 7 中的相同位置并粘贴文件夹。

/Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport /Applications/Xcode7.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport

/Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport /Applications/Xcode7.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport

enter image description here

在此处输入图片说明

Restart Xcode 7. You'll have to wait a while for Xcode to rebuild the symbols etc.

重新启动 Xcode 7。您必须等待一段时间,以便 Xcode 重建符号等。

回答by rak appdev

For me none of the above suggestions worked.

对我来说,上述建议均无效。

Instead, I navigated to this location(press CMD+SHIFT+K to insert the below path) (through finder)

相反,我导航到这个位置(按 CMD+SHIFT+K 插入下面的路径)(通过 finder)

/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

And copied the 10.0(14A5339a)folder, which contains the developer disk image. I then pasted it into

并复制了10.0(14A5339a)包含开发人员磁盘映像的文件夹。然后我把它粘贴到

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

EDIT: I'm using Xcode7 (version 7.3.1-7D1014),iOS 10 public beta 6(14A5345a)-this is released on aug 19,2016

编辑:我使用的是 Xcode7(版本 7.3.1-7D1014),iOS 10 public beta 6(14A5345a)-这是 2016 年 8 月 19 日发布的

回答by TheFuquan

Although copying the folder containing the disk image is still the best way to go, i had no time downloading the newest Xcode to get hold of the disk image folder, so i basically archived the app and exported it using the save for development deployment option, then installed it on the test device using iTunes app.

虽然复制包含磁盘映像的文件夹仍然是最好的方法,但我没有时间下载最新的 Xcode 来获取磁盘映像文件夹,所以我基本上存档了应用程序并使用保存开发部署选项将其导出,然后使用 iTunes 应用程序将其安装在测试设备上。

In my case i hade Xcode 8.0 wanting to build on a 10.2.1 iOS device.

就我而言,我希望在 10.2.1 iOS 设备上构建 Xcode 8.0。

enter image description here

在此处输入图片说明

回答by ingconti

Pascal && Fanruten are right.

Pascal && Fanruten 是对的。

tested on 12th aug, Xcode Version 7.3.1 (7D1014) AND iOS 10.0 (14A5309d) on iPhone6 Plus.

8 月 12 日在 iPhone6 Plus 上测试了 Xcode 版本 7.3.1 (7D1014) 和 iOS 10.0 (14A5309d)。

I made a symbolic link as suggested (path are a bit different... see below.) but works with linking to Xcode Version 8.0 beta 4 (8S188o).

我按照建议创建了一个符号链接(路径有点不同……见下文。)但可以链接到 Xcode 8.0 测试版 4 (8S188o)。

only for completeness:

仅出于完整性考虑:

Beta 4

测试版 4

sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5322e\)/  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0

Beta 5

测试版 5

sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5339a\)/  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0

回答by Bryan

Here it is for XCode 9 and iOS 11 Beta 1:

这是用于 XCode 9 和 iOS 11 Beta 1 的:

sudo ln -s \
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) \
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0

回答by D. Rothschild

Tymac's answer almost worked for me. Rather than copy and past, I had two Finder windows opened and then dragged the iOS 10 folder to the Xcode 7 folder. Once it's in Xcode 7, open the folder and make sure there is a dmg file.

Tymac 的回答几乎对我有用。我没有复制和过去,而是打开了两个 Finder 窗口,然后将 iOS 10 文件夹拖到 Xcode 7 文件夹中。一旦它在 Xcode 7 中,打开文件夹并确保有一个 dmg 文件。

Earlier I had dragged a copy of the iOS 10 device support folder to my desktop then copied it to the Xcode 7 folder. That seemed to unpack the dmg file so Xcode 7 still complained. Needs to be a dmg file in the folder.

早些时候,我将 iOS 10 设备支持文件夹的副本拖到我的桌面,然后将其复制到 Xcode 7 文件夹。这似乎解压了 dmg 文件,所以 Xcode 7 仍然抱怨。需要是文件夹中的dmg文件。

回答by 3176243

One warning. I tried to use XCode 7.3.1 with ios 10 images from XCode 8.1 for cordova project (it works), but had problems with push notifications permissions (different setups for ios 8/9/10). Not sure about it, but it seems to me that some compiler directives are missing in 7.3.1

一警告。我尝试将 XCode 7.3.1 与来自 XCode 8.1 的 ios 10 图像一起用于cordova 项目(它有效),但在推送通知权限方面存在问题(ios 8/9/10 的不同设置)。不确定,但在我看来,7.3.1 中缺少一些编译器指令

回答by ingconti

my two cents for Xcode Version 11 beta against Xcode 10 after wwdc2019:

在 wwdc2019 之后,我对 Xcode 11 测试版和 Xcode 10 的两分钱:

ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0

ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0

so I can use my iPhone with iOS 13 beta in Xcode 10.

所以我可以在 Xcode 10 中使用我的 iPhone 和 iOS 13 beta。

after ln -s , pls relaunch Xcode

在 ln -s 之后,请重新启动 Xcode