xcode 由于 Playground 进程意外退出,Playground 执行终止

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

Playground execution terminated because the playground process exited unexpectedly

iosxcodeswiftswift-playground

提问by zeiteisen

I want to use a playground in Xcode 6.0.1. So File -> New -> Playground

我想在 Xcode 6.0.1 中使用游乐场。所以文件 -> 新建 -> 游乐场

I get immediately the error. Playground execution terminated because the playground process exited unexpectedly. See image. Restart Xcode didn't helped.

我立即得到错误。由于 Playground 进程意外退出,Playground 执行终止。见图片。重新启动 Xcode 没有帮助。

Whats wrong with Xcode?Xcode Error

Xcode 有什么问题?Xcode 错误

采纳答案by zeiteisen

A restart of the mac solves the problem. What causes the issue is still unknown.

重启 mac 即可解决问题。导致问题的原因仍然未知。

回答by smileBot

New Answer:

新答案:

As @Woomin points out in the comments, first try restarting Xcode and rebooting your Mac, and if that fails try the following:

正如@Woomin 在评论中指出的那样,首先尝试重新启动 Xcode 并重新启动您的 Mac,如果失败,请尝试以下操作:

Try deleting the .simruntime files:

尝试删除 .simruntime 文件:

enter image description here

在此处输入图片说明

I found them located here in my root directory:

我发现它们位于我的根目录中:

enter image description here

在此处输入图片说明

Old Answer:

旧答案:

If the above doesn't work try removing everything in the Developerfolder located at /Library/Developer/. If this still doesn't work try removing everything in ~/Library/Developer/. If this still doesn't solve it remove xcode with AppCleaner and reinstall it using the MAS version. I found that doing this last thing solved the issue but it came back when I installed the simulators from xcode's download tab. Removing the .simruntime files finally solved it for me. BTW, I'm using version 7.2.

如果上述方法不起作用,请尝试删除Developer位于/Library/Developer/. 如果这仍然不起作用,请尝试删除~/Library/Developer/. 如果这仍然不能解决它,请使用 AppCleaner 删除 xcode 并使用 MAS 版本重新安装它。我发现做最后一件事解决了这个问题,但是当我从 xcode 的下载选项卡安装模拟器时它又回来了。删除 .simruntime 文件终于为我解决了这个问题。顺便说一句,我使用的是 7.2 版。

回答by Zhao

Thanks smileBot's answer. I am able to make it work with 7.2 too. I did try differently.

感谢smileBot的回答。我也可以让它与 7.2 一起使用。我确实尝试了不同的方法。

I installed Xcode 7.2 release version via downloading. However it had problem mentioned above. I first deleted the Xcode 7.2 via AppCleaner completely. Empty the trash. Also cleaned the derived data using WatchDog for XcodeAnd then restart the machine. Try again, it did not work.

我通过下载安装了 Xcode 7.2 发行版。但是它有上面提到的问题。我首先通过 AppCleaner 完全删除了 Xcode 7.2。清空垃圾。还使用WatchDog for Xcode清理了派生数据,然后重启机器。再试一次,还是不行。

So I went ahead deleted the folder ~/Library/Developer/and then restart, try again, I can use Playground again in Xcode 7.2 again.

所以我继续删除文件夹~/Library/Developer/,然后重新启动,再试一次,我可以再次在 Xcode 7.2 中使用 Playground。

回答by MppleHero

Xcode 7.2 and Mac os x 10.11.2 Restart Xcode or mac does not worked for me. I solve this problem is that delete the Simulator Profiles. The Path is ~/Library/Developer/CoreSimulator/Profiles/Runtimes. Delete all Runtimes. Than Restart the Xcode, problem has been solved.

Xcode 7.2 和 Mac os x 10.11.2 重新启动 Xcode 或 mac 对我不起作用。我解决这个问题是删除模拟器配置文件。路径是 ~/Library/Developer/CoreSimulator/Profiles/Runtimes。删除所有运行时。重新启动Xcode,问题已解决。

回答by Sophy Swicz

It's not necessary to delete manually Developer's folder. Just follow this steps in Command Line (CL).

没有必要手动删除 Developer 的文件夹。只需在命令行 (CL) 中执行此步骤即可。

Quit Xcode.app, Simulator.app and all Xcode related and then in CL:

退出 Xcode.app、Simulator.app 和所有 Xcode 相关的,然后在 CL 中:

 sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

 rm -rf ~/Library/*/CoreSimulator

回答by Anshu Kumar Gupta

A restart of Xcode solves the problem , most of the times . (Do remember to quit from the dock too)

大多数情况下,重新启动 Xcode 可以解决该问题。(也记得退出码头)

If that doesn't work a restart of Mac is all that is required

如果这不起作用,则只需要重新启动 Mac

回答by Damo

This happened to me and I found that the platform setting wasn't set for my playground. Probably because the playground was created in a previous version of XCode which didn't require it.

这发生在我身上,我发现没有为我的操场设置平台设置。可能是因为 Playground 是在不需要它的先前版本的 XCode 中创建的。

Solution:

解决方案:

Double click on your playground to open it in XCode and wait for the fail message. Dismiss the message (it may appear more than once) and do the following

双击您的 Playground 以在 XCode 中打开它并等待失败消息。关闭消息(它可能出现多次)并执行以下操作

1.Select to show the project navigator pane.

1.选择以显示项目导航器窗格。

enter image description here

在此处输入图片说明

2.Select the workspace in the navigator.

2. 在导航器中选择工作区。

enter image description here

在此处输入图片说明

3.Select to show the Utilities pane.

3.选择以显示实用程序窗格。

enter image description here

在此处输入图片说明

4.In the playground settings area of the Identity inspector. Select OSX (or iOS)

4.在身份检查器的操场设置区域。选择 OSX(或 iOS)

enter image description here

在此处输入图片说明

回答by Strictly Taboo

OSX 10.11.2 and Xcode 7.2

OSX 10.11.2 和 Xcode 7.2

I had gotten a reply to his from a member on the Apple Developer Forum and wanted to provide some additional information on my fix for this. First I deleted the ~/Library/Developerfolder as indicated. Looking into it it had the some Simulator Profiles. I didn't know what that had to do with the Playground issue so I did NOT empty the Trash. I rebooted and the playground worked.

我从 Apple 开发者论坛上的一位成员那里得到了他的回复,并想提供一些关于我修复此问题的其他信息。首先,我~/Library/Developer按照指示删除了文件夹。调查它有一些Simulator Profiles。我不知道这与 Playground 问题有什么关系,所以我没有清空 Trash。我重新启动,操场工作。

I put back the folder and the playground had the issues again. I one by one removed the simulator profiles in the sub directory ultimately removing ALL of the profileswithout deleting the ~/Library/Developerfolder structure and the Playground works.

我放回文件夹,操场又出现了问题。我将子目录中的模拟器配置文件一一删除,最终删除了所有的配置文件,而没有删除~/Library/Developer文件夹结构,Playground 工作正常。

回答by Areal-17

With Xcode 7.2 (7C68) i had the same problem. I'd solve it by changing the entry of the runtimevalue from com.apple.CoreSimulator.SimRuntime.iOS-9-1to com.apple.CoreSimulator.SimRuntime.iOS-9-2. I'd changed it in the device.plist. In ~/Library/Developer/CoreSimulator/XCPGDevices/ is one or more folder with a UUID as name. In one of this folders is the current device.plist.enter image description here

使用 Xcode 7.2 (7C68) 我遇到了同样的问题。我会通过将运行时值的条目从 c om.apple.CoreSimulator.SimRuntime.iOS-9-1更改为com.apple.CoreSimulator.SimRuntime.iOS-9-2来解决它。我在 device.plist 中更改了它。在 ~/Library/Developer/CoreSimulator/XCPGDevices/ 中有一个或多个以 UUID 作为名称的文件夹。其中一个文件夹是当前的 device.plist。在此处输入图片说明

回答by Teja Swaroop

Install Command line tools using command

使用命令安装命令行工具

xcode-select --install

xcode-select --install

then u will get an update in Appstore install that app Problem will be solved.

然后您将在 Appstore 中获得更新安装该应用程序问题将得到解决。