错误!找不到 iPhoneSimulator SDK 9.0 RubyMotion

ERROR! Can't locate iPhoneSimulator SDK 9.0 RubyMotion

我有 Xcode 7.1.1。我已经下载了 iPhone 9.0 模拟器,但我仍然收到此错误。

❯ Rake
    ERROR! Can't locate iPhoneSimulator SDK 9.0 at `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk'

我还在我的 Rakefile 中添加了 sdk 版本 9.0。

❯ cat Rakefile
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'

begin
  require 'bundler'
  Bundler.require
rescue LoadError
end

Motion::Project::App.setup do |app|
  app.sdk_version = "9.0"
  app.deployment_target = "9.0"
  # Use `rake config' to see complete project settings.
  app.name = 'HelloMotion'
end

我已经下载了 iOS 9.0 模拟器。您可以在下面的屏幕截图中看到。

iOS 9.0 模拟器和 iOS 9.0 模拟器 SDK 是两个不同的东西。

旧版 iOS 模拟器 SDK 不再随最新版本的 Xcode 一起提供。要安装较旧的模拟器 SDK,请从较旧版本的 Xcode (Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/‌​iPhoneSimulator.sdk) 中获取 iPhoneSimulator.sdk 目录,并将其复制到较新版本。

例如,Xcode 7.0 附带 9.0 iOS Simulator SDK。要在 Xcode 7.1 中安装它,请进入目录:

Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk

将其从 iPhoneSimulator.sdk 重命名为 iPhoneSimulator9.0.sdk

将其复制到您的 Xcode 7 Simulator SDK 目录:

Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

运行 xcodebuild -showsdks 在您的终端中观察您的新模拟器 SDK。

命令 xcode-select 提供您正在寻找的功能 - 即 select 在 Xcode.

的多个已安装版本之间