简体   繁体   English

如何在 macOS Mojave 10.14.6 上运行 Xcode 11.4

[英]How to run Xcode 11.4 on macOS Mojave 10.14.6

Background on problem:问题背景:

I have an iPhone 6s that has updated itself to iOS 13.4.我有一部 iPhone 6s,它已将自身更新到 iOS 13.4。 Before the iOS update, I could code + run my app on the device from Xcode, great.在 iOS 更新之前,我可以在 Xcode 的设备上编码 + 运行我的应用程序,太好了。

Now I can't run my app from Xcode on the device to test my code, as it says:现在我无法从设备上的 Xcode 运行我的应用程序来测试我的代码,正如它所说:

Xcode could not locate device support files
This iPhone 6s is running iOS 13.4 (17E255), which may not be supported by this version of Xcode. An updated version of Xcode may be found on the App Store or at developer.apple.com.

So I tried installing the latest Xcode (11.4) which now says I have to update my whole OS to Catalina.所以我尝试安装最新的 Xcode (11.4),它现在说我必须将我的整个操作系统更新到 Catalina。

I don't want to do this as my system is working fine and I have heard bad things about that release.我不想这样做,因为我的系统运行良好,而且我听说过有关该版本的坏消息。

Question:问题:

Is there a way I can get Xcode building to my iPhone without updating my whole OS and potentially screwing up my whole machine?有没有一种方法可以让 Xcode 构建到我的 iPhone 上,而无需更新我的整个操作系统并可能搞砸我的整个机器?

You cannot run Xcode 11.4 on Mojave but you can add support for iOS 13.4您无法在 Mojave 上运行 Xcode 11.4,但您可以添加对 iOS 13.4 的支持

  • Download the 13.4 image from this repo从此repo下载 13.4 映像
  • Quit Xcode退出 Xcode
  • Unzip the archive and move the folder into /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport解压缩存档并将文件夹移动到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
  • Launch Xcode发射 Xcode

Consider that this way adds only the support for iOS 13.4, nothing else.考虑到这种方式只增加了对 iOS 13.4 的支持,没有别的。

Update: This does not work with iOS 14 because iOS 14 requires Xcode 12.更新:这不适用于 iOS 14,因为 iOS 14 需要 Xcode 12。

Here's an alternative solution that doesn't require downloading files from an untrusted source:这是不需要从不受信任的来源下载文件的替代解决方案:

  1. Install the latest release of Xcode that runs on Mojave (currently Xcode 11.3.1).安装在 Mojave 上运行的最新版 Xcode(当前为 Xcode 11.3.1)。 It can be downloaded from Apple's developer pages .它可以从 Apple 的开发者页面下载。

  2. From the same page, download a release of Xcode that supports iOS 13.4 (for example Xcode 11.4.1).从同一页面下载支持 iOS 13.4 的 Xcode 版本(例如 Xcode 11.4.1)。 Unzip it, rename it to "Xcode-11.4.1.app" and move it to the Applications folder, but don't run it.解压它,将其重命名为“Xcode-11.4.1.app”并将其移动到 Applications 文件夹,但不要运行它。

  3. Add a symbolic link for iOS 13.4 from the DeviceSupport folder in Xcode 11.4.1 to Xcode 11.3.1, as described in Peter Steinberger's Gist .从 Xcode 11.4.1 的 DeviceSupport 文件夹中添加 iOS 13.4 的符号链接到 ZA3B5EBD8A1E9EBF44A172E80D5A7D3A3A3Z 11.3.1,如Steinberg所述。

If you use the versions used in this answer, the command to add the symbolic link would be如果您使用此答案中使用的版本,添加符号链接的命令将是

sudo ln -s /Applications/Xcode-11.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.4 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

You can run Xcode 11.4 - 11.7 on your Mac which is running 10.14.您可以在运行 10.14 的 Mac 上运行 Xcode 11.4 - 11.7。

  1. Download Xcode 11.4 ~ 11.7 from https://developer.apple.com/download/https://developer.apple.com/download/下载 Xcode 11.4 ~ 11.7
  2. Extract the.xip file, and you will get Xcode.app解压.xip文件,你会得到Xcode.app
  3. Modify LSMinimumSystemVersion in Xcode.app/Contents/Info.plist from 10.15.x to 10.14 LSMinimumSystemVersion中的Xcode.app/Contents/Info.plist从 10.15.x 修改为 10.14
  4. Now you can use Xcode 11.4 ~ 11.7 without upgrading to Catalina.现在您无需升级到 Catalina 即可使用 Xcode 11.4 ~ 11.7。

However, this trick doesn't work for Xcode 12, which requires some frameworks that do not exists in macOS Mojave.但是,此技巧不适用于 Xcode 12,它需要一些 macOS Mojave 中不存在的框架。

My Apple TV 4K was running tvOS 13.3 and I upgraded to 13.4 which required that I use this technique to keep working with Xcode 11.3.1.我的 Apple TV 4K 运行的是 tvOS 13.3,我升级到 13.4,这要求我使用这种技术来继续使用 Xcode 11.3.1。

What is odd is that in the DeviceSupport folder, Xcode 11.3.1 only ships with tvOS up to 13.2.奇怪的是,在 DeviceSupport 文件夹中,Xcode 11.3.1 仅附带最高 13.2 的 tvOS。 So how did it ever work with a hardware device running 13.3?那么它是如何与运行 13.3 的硬件设备一起工作的呢? I guess 13.2 and 13.3 are close enough that 13.2 still works.我猜 13.2 和 13.3 足够接近,以至于 13.2 仍然可以工作。

13.4 does not work out of the box, so I copied both 13.3 and 13.4 from the Xcode 11.4.1 app into my 11.3.1 app. 13.4 无法开箱即用,因此我将 Xcode 11.4.1 应用程序中的 13.3 和 13.4 复制到了我的 11.3.1 应用程序中。 All is well again.一切都好起来了。

You can run Xcode 11.4 - 11.7 on your Mac which is running 10.14.您可以在运行 10.14 的 Mac 上运行 Xcode 11.4 - 11.7。

  • Download Xcode 11.4 ~ 11.7 from https://developer.apple.com/download/https://developer.apple.com/download/下载 Xcode 11.4 ~ 11.7
  • Extract the.xip file, and you will get Xcode.app解压.xip文件,你会得到Xcode.app
  • Modify LSMinimumSystemVersion in Xcode.app/Contents/Info.plist from 10.15.x to 10.14.6 LSMinimumSystemVersion中的Xcode.app/Contents/Info.plist从 10.15.x 修改为 10.14.6

Now you can use Xcode 11.4 ~ 11.7 without upgrading to Catalina.现在您无需升级到 Catalina 即可使用 Xcode 11.4 ~ 11.7。 However, this trick doesn't work for Xcode 12. I tried this trick on my mac mojave 10.4.6但是,此技巧不适用于 Xcode 12。我在我的 mac mojave 10.4.6 上尝试了此技巧

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM