Xcode iOS 项目仅显示“我的 Mac 64 位”而不显示模拟器或设备

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

Xcode iOS project only shows "My Mac 64-bit" but not simulator or device

iosxcodexcode4

提问by Nic Hubbard

This just started happening that my iOS project is only showing "My Mac 64-bit" rather than the Simulator or my iPhone to build to. I have no idea why this is happening. I do not think that I have changed anything.

这刚刚开始发生,我的 iOS 项目只显示“我的 Mac 64 位”而不是模拟器或我的 iPhone 来构建。我不知道为什么会这样。我不认为我改变了任何东西。

enter image description here

在此处输入图片说明

I have my project set to iOS 5 as the base SDK, but no matter what I do it seems to never show my any other options to build for. I have restarted Xcode a few times, and still no luck.

我将我的项目设置为 iOS 5 作为基础 SDK,但无论我做什么,它似乎都没有显示我的任何其他构建选项。我已经重新启动了 Xcode 几次,但仍然没有运气。

Why is the happening?

为什么会发生?

Xcode 4.2, Build 4D199

Xcode 4.2,版本 4D199

回答by Nic Hubbard

I figured it out. I had to edit the scheme (Product->Scheme->Edit Scheme...), and for some reason no executable was selected. I chose my app, saved and now I have my simulator and device options back.

我想到了。我不得不编辑方案(产品->方案->编辑方案...),由于某种原因没有选择可执行文件。我选择了我的应用程序并保存,现在我的模拟器和设备选项又回来了。

回答by Mike Reining

Here is how I solved this problem. Right-click on the xcodeproj file and select "show package contents." Now delete everything inside the xcuserdata folder. Voila. I hope it helps anyone else out there that is facing this problem.

这是我解决这个问题的方法。右键单击 xcodeproj 文件并选择“显示包内容”。现在删除 xcuserdata 文件夹中的所有内容。瞧。我希望它可以帮助其他面临此问题的人。

回答by Tulon

This is basically happen, when you change your project name or something like that. The solution is, you have to select the right "Scheme" for your project. Here is the solution :

当您更改项目名称或类似内容时,这基本上会发生。解决方案是,您必须Scheme为您的项目选择正确的“ ”。这是解决方案:

After open your project :

打开您的项目后:

  1. Go to "Product" from upper menu
  2. Select "Scheme" from the list
  3. Then select "Manage Scheme"
  4. Now no matter your "Project Name" is listed here or not just click on "Autocreate Schemes Now" from the upper-right side of the window.
  5. Press "ok", now your project rebuild and you can find the "Simulator List" on the top.
  1. Go to "Product" from upper menu
  2. Select "Scheme" from the list
  3. Then select "Manage Scheme"
  4. Now no matter your "Project Name" is listed here or not just click on "Autocreate Schemes Now" from the upper-right side of the window.
  5. Press "ok", now your project rebuild and you can find the "Simulator List" on the top.

Hope this help you guys.

希望这对你们有帮助。

回答by Himanshu Singh

Had the same problem.

有同样的问题。

None of the above solutions worked. In the end, I clicked on "Manage Schemes" and then "Autocreate Schemes Now". Then select the new scheme in Xcode. Now you will get back all device/simulator options.

上述解决方案均无效。最后,我单击“管理方案”,然后单击“立即自动创建方案”。然后在 Xcode 中选择新方案。现在您将获得所有设备/模拟器选项。

This might be a bit nuclear option if you are midway through the project. My problem happened as I was starting on a new project and renamed the project. In this scenario, only autocreating a new scheme seemed to work.

如果您在项目中途,这可能是一个核选项。我的问题发生在我开始一个新项目并重命名该项目时。在这种情况下,似乎只有自动创建新方案才有效。

回答by Jayprakash Dubey

There are different solution to this problem. Two approaches that I have used are below :

这个问题有不同的解决方案。我使用的两种方法如下:

  1. Right-click on xcodeproj file. Select "show package contents". Now, delete everything inside the xcuserdata folder.

  2. Select "Edit Schema". Executable section will have "none" in Info tab of window. Now select "ProjectName.app".

  1. 右键单击 xcodeproj 文件。选择“显示包内容”。现在,删除 xcuserdata 文件夹中的所有内容。

  2. 选择“编辑架构”。可执行部分将在窗口的“信息”选项卡中显示“无”。现在选择“ProjectName.app”。

Screenshot

截屏

回答by Christian Schlensker

Often times this can happen when some files change without xcode's blessing. As in when switching between version control branches. Usually restarting Xcode fixes that problem.

通常,当某些文件在没有 xcode 支持的情况下发生更改时,就会发生这种情况。就像在版本控制分支之间切换时一样。通常重新启动 Xcode 可以解决这个问题。

回答by danharper

None of the suggestions here worked for me, but what did was clicking the project in the sidebar, then under "iOS Application Target", toggle "Devices".

这里没有任何建议对我有用,但是点击侧栏中的项目,然后在“iOS 应用程序目标”下,切换“设备”。

I was set to 'iPad'. I changed it to 'Universal' then back to 'iPad' and the Scheme corrected itself.

我被设置为“iPad”。我将其更改为“Universal”,然后又改回“iPad”,该计划自行纠正。

If it makes a difference, this is on a PhoneGap/Cordova project.

如果它有所作为,这是在 PhoneGap/Cordova 项目中。

回答by Josh

If you are seeing this problem after you renamed your project, the actual issue is that the scheme has a container defined that refers to your old project name. You have to edit your scheme file also in a text editor and replace all the instances of the old project name with your new project name.

如果您在重命名项目后看到此问题,则实际问题是该方案定义了一个引用您旧项目名称的容器。您还必须在文本编辑器中编辑您的方案文件,并将旧项目名称的所有实例替换为新项目名称。

You've got to go through all the sub files in the project folder and replace the name of the old project with the new one to fix this issue. All the other work arounds listed in the other answers are just ways to force Xcode to do this for you.

您必须浏览项目文件夹中的所有子文件,并用新项目的名称替换旧项目的名称才能解决此问题。其他答案中列出的所有其他解决方法只是强制 Xcode 为您执行此操作的方法。

回答by Malloc

I got this issue when i created a project with Xcode 4.5 (iOS SDK 6) and opened it later with Xcode 4.2 (iOS SDK < 6). I solved this problem, Select target->Summary, under Deployment target, i set it to 5.0:

当我使用 Xcode 4.5 (iOS SDK 6) 创建一个项目并稍后使用 Xcode 4.2 (iOS SDK < 6) 打开它时,我遇到了这个问题。我解决了这个问题,选择目标->摘要,在部署目标下,我将其设置为5.0:

enter image description here

在此处输入图片说明

Xcode 4.2 doesn't support iOS SDK 6.0, so i need to downgrade the deployment target, then i got my device in the scheme. Hope this help someone.

Xcode 4.2 不支持 iOS SDK 6.0,所以我需要降级部署目标,然后我的设备在方案中。希望这有助于某人。

回答by Mann

If nothing above work then click project from side bar as shown in image at top then go to PROJECT then Build Settings then under Architectures change Supported Platforms from OSX to iOS.

如果以上都不起作用,则从侧边栏中单击项目,如顶部图像所示,然后转到 PROJECT,然后转到 Build Settings,然后在 Architectures 下将 Supported Platforms 从 OSX 更改为 iOS。

Hope it will helps!

希望它会有所帮助!

enter image description here

在此处输入图片说明