ios Xcode 项目未显示模拟器列表

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

Xcode project not showing list of simulators

iosxcodexcode6.1

提问by Katedral Pillon

I open my project in Xcode 6.1. When I try to run the project, the button is grayed out. When I try to go to Product > Clean, the option is grayed out. When I look at the list of simulators, all I get is My Macinstead of the usually iOS Device. How do I get my simulators to come back?

我在 Xcode 6.1 中打开我的项目。当我尝试运行该项目时,该按钮呈灰色。当我尝试转到 时Product > Clean,该选项变灰。当我查看模拟器列表时,我得到的只是My Mac而不是通常的iOS Device. 我如何让我的模拟器回来?

采纳答案by Akshit Zaveri

Click on the project name (Right to the Run button). Three options will appear.

单击项目名称(运行按钮的右侧)。将出现三个选项。

  1. Edit scheme
  2. New scheme
  3. Manage scheme
  1. 编辑方案
  2. 新方案
  3. 管理方案

You can click on "New scheme" and then click on "OK" in popup window.

您可以单击“新方案”,然后在弹出窗口中单击“确定”。

You will have simulators list back.

您将获得模拟器列表。

回答by Ans

Make sure that the project you are trying to run has deployment targetequal to or less then the SDK version of your Xcode. In my case I tried to run a project which was built using iOS8.4but I have Xcode6.1 with SDK version 8.1

确保您尝试运行的项目deployment target等于或小于 Xcode 的 SDK 版本。在我的情况下,我试图运行一个使用它构建的项目,iOS8.4但我有 Xcode6.1 和 SDK 版本 8.1

I changed the deployment target to 8.1 and it start showing me simulators.

我将部署目标更改为 8.1,它开始向我展示模拟器。

P.S before doing this, make sure that your code and external libraries are compatible with your new deployment target, else you have to update your Xcode.

PS 在执行此操作之前,请确保您的代码和外部库与您的新部署目标兼容,否则您必须更新您的 Xcode。

回答by Jaywant Khedkar

Try This, It worked like a charm! for me,

试试这个,它就像一个魅力!为了我,

Follow below step

按照下面的步骤

1) Clean Derived Dataas show below,

1)清理派生数据,如下所示,

 rm -rf ~/Library/Developer/Xcode/DerivedData/

OR

 Xcode---> Preferences--->Location--->Derived Data

Derived Data

派生数据

2) In Deployment Info changeDeployment Target

2)在部署信息更改部署目标

It's equalto or lessthen the SDKversion of Xcode

等于小于XcodeSDK版本

enter image description here

在此处输入图片说明

3) QuitXcode

3)退出Xcode

enter image description here

在此处输入图片说明

4) Reopen Xcodeyou will see list of simulators

4) 重新打开Xcode,您将看到模拟器列表

enter image description here

在此处输入图片说明

Hope this answer will help for someone.

希望这个答案对某人有所帮助。

回答by Tumata

I could not find any solution that would fix my issue. All simulators were there for all projects but the one that I needed them.

我找不到任何可以解决我的问题的解决方案。所有模拟器都适用于所有项目,但我需要它们的那个。

Solution:

解决方案:

Build Settings -> Architectures -> Supported Platforms:

构建设置 -> 架构 -> 支持的平台:

changed from iphoneosto iOS

iphoneos更改为iOS

回答by shshnk

Also check the iOS Deployment Targetunder build settings. I was using Xcode 6.3 while the deployment target was set to iOS 8.4. I got the list of simulators as soon as I set it to iOS 8.3 enter image description here

还要检查iOS Deployment Target下构建设置。我使用的是 Xcode 6.3,而部署目标设置为 iOS 8.4。我一设置为 iOS 8.3 就得到了模拟器列表 在此处输入图片说明

回答by Kjuly

Cmd below solved my problem:

下面的 Cmd 解决了我的问题:

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer


In my case, I upgraded to Xcode 8 and downloaded another version 7.3.1 later (renamed it to "Xcode 7.3.1"), then cannot get the simulator list in Xcode 8.

就我而言,我升级到 Xcode 8 并稍后下载另一个版本 7.3.1(将其重命名为“Xcode 7.3.1”),然后无法在 Xcode 8 中获取模拟器列表。

回答by Azik Abdullah

In my case i'd accidentally deleted ios devices in system Finder -> Library->Devices->Core simulator

就我而言,我不小心删除了系统 Finder -> Library->Devices->Core Simulator 中的 ios 设备

So, the simulators are not listed in the Xcode project except ios device.

因此,除了 ios 设备之外,Xcode 项目中未列出模拟器。

I solved this by adding ios simuulators from Xcode->Window->Devices->Add simulators

我通过从 Xcode->Window->Devices->Add Simulators 添加 ios 模拟器解决了这个问题

enter image description here

在此处输入图片说明

Hope it'll help someone.

希望它会帮助某人。

回答by Jeremy Huddleston Sequoia

If you renamed Xcode.app since first launch, the iOS Simulator becomes unavailable. This is mentioned in the Xcode 6.1 Release Notes:

如果您在首次启动后重命名 Xcode.app,则 iOS 模拟器将不可用。这在Xcode 6.1 发行说明中提到:

Renaming Xcode.app after running any of the Xcode tools in that bundle may cause iOS Simulator to be no longer be available. Either rename Xcode.app back to what it was when first launched or restart your Mac. (16646772)

在运行该包中的任何 Xcode 工具后重命名 Xcode.app 可能会导致 iOS 模拟器不再可用。将 Xcode.app 重命名为首次启动时的名称或重新启动 Mac。(16646772)

回答by bittu

Go to Window then Devices and press the plus button at the bottom left to add a device and select the simulator which are required.This worked for me.

转到窗口,然后转到设备,然后按左下角的加号按钮添加设备并选择所需的模拟器。这对我有用。

回答by xuzepei

Solution: Build Settings -> Architectures -> Supported Platforms: changed from iphoneos to iOS

解决方案:Build Settings -> Architectures -> Supported Platforms:从iphoneos改为iOS

Confirmed works in Xcode Version 9.0 (9A235)

确认在 Xcode 版本 9.0 (9A235) 中有效