Xcode 10 在安装 Carthage 依赖项时找不到任何适用于 iOS 的模拟器

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

Xcode 10 Could not find any available simulators for iOS when install Carthage dependencies

xcodeios-simulatorcarthage

提问by kroko

I'm trying to install Carthage dependencies in my Xcode project with the

我正在尝试在我的 Xcode 项目中安装 Carthage 依赖项

Carthage bootstrap --platform iOS 

command line but It's fail and I have this message in my terminal:

命令行,但它失败了,我的终端中有此消息:

Could not find any available simulators for iOS

I've just updated Xcode with the 10 version then the simulators are already installed.

我刚刚用 10 版本更新了 Xcode,然后模拟器已经安装。

I've also tried to delete each one and reinstall only one with iOS 12.

我还尝试删除每一个,并在 iOS 12 中仅重新安装一个。

I have still the same error.

我仍然有同样的错误。

回答by Tomá? Linhart

What worked for me was uninstalling Carthage and installing it again.

对我有用的是卸载 Carthage 并重新安装。

brew uninstall carthage --force
brew install carthage

回答by SoftDesigner

Upgrading to v0.31.1 or v0.31.2 fixes it:

升级到 v0.31.1 或 v0.31.2 修复它:

brew update && brew upgrade carthage

回答by lamine

When a new xcode version comes out, it tends to happen. You can try to update Carthage with brew upgrade carthageif installed with Brew

当一个新的 xcode 版本出来时,它往往会发生。brew upgrade carthage如果与 Brew一起安装,您可以尝试更新 Carthage

回答by Jon Reid

After installing Xcode 10.1, I had trouble even with Carthage 0.31.2. But I also have a habit of deleting all simulators when installing Xcode major versions. Adding a simulator for iOS 12.1 fixed things.

安装 Xcode 10.1 后,即使使用 Carthage 0.31.2 我也遇到了麻烦。但我也有安装Xcode主要版本时删除所有模拟器的习惯。为 iOS 12.1 添加一个模拟器修复了一些问题。

回答by Alex Zavatone

Just upgrade your Carthage.

只需升级您的迦太基。

As indicated in other answers the cause behind this is that a key indicating simulator model availability changed in a recent update to Xcode 10.x. It was

正如其他答案中所指出的,这背后的原因是在最近的 Xcode 10.x 更新中,指示模拟器模型可用性的键发生了变化。它是

"availability" : "(available)",

and it is now

现在是

"isAvailable" : true,

Upgrading Carthage to 0.33.0 fixes this.

将 Carthage 升级到 0.33.0 解决了这个问题。

Using brew, enter the following to update Carthage

使用 brew,输入以下内容更新 Carthage

brew upgrade carthage

Notice the word is upgrade, not update.

注意这个词是upgrade,而不是 update 。

Check the version of carthage

检查迦太基版本

brew list --versions carthage

carthage 0.33.0

carthage 0.33.0

And in the terminal at the root of your project, enter this to rebuild your Carthage dependancies.

在项目根目录的终端中,输入此内容以重建您的 Carthage 依赖项。

carthage bootstrap --platform iOS

They all should build as expected.

他们都应该按预期构建。

You can check the data format of the available simulators through this command.

您可以通过该命令查看可用模拟器的数据格式。

xcrun simctl list devices --json

xcrun simctl list devices --json

回答by Tung Tran

try to run

试着跑

sudo brew install --HEAD carthage

sudo brew install --HEAD carthage

Since Xcode 10.1 beta, Structures of xcrun simctl list devices --json is changed.

从 Xcode 10.1 beta 开始,xcrun simctl list devices --json 的结构发生了变化。

Before

{
  "devices" : {
    "iOS 12.0" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 5s",
        "udid" : "A52BF797-F6F8-47F1-B559-68B66B553B23"
      }
  ]
}

After

{
  "devices" : {
    "iOS 12.0" : [
      {
        "state" : "Shutdown",
        "isAvailable" : "YES",
        "name" : "iPhone 5s",
        "udid" : "A52BF797-F6F8-47F1-B559-68B66B553B23"
      }
  ]
}

Because of this changes, parsing on Xcode 10.1 is failed.

由于此更改,在 Xcode 10.1 上解析失败。

回答by Jayprakash Dubey

Uninstalling and installing Carthage trick worked for me!

卸载和安装 Carthage 技巧对我有用!

brew uninstall carthage —force

Screenshot

截屏

brew install carthage

回答by Carlos Chaguendo

In my case it was solved.

就我而言,它已解决。

  1. Close xcode
  2. rm -rf ~/Library/Developer/CoreSimulator/Devices/
  3. Open xcode
  4. Create new project
  5. Run empty project on any simulator
  6. execute carthage update
  1. 关闭 xcode
  2. rm -rf ~/Library/Developer/CoreSimulator/Devices/
  3. 打开 xcode
  4. 创建新项目
  5. 在任何模拟器上运行空项目
  6. 执行 carthage update