Xcode 构建和运行错误:“进程启动失败:无法获取进程 216 的任务”

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

Xcode build & run error: "Process launch failed: Failed to get the task for process 216"

iphonexcodexcode5osx-mavericks

提问by iamjustaprogrammer

After updating to Mavericks and making sure I got the latest updates of Xcode installed as well, Xcode suddenly fails to launch apps on the device.

更新到 Mavericks 并确保我也安装了 Xcode 的最新更新后,Xcode 突然无法在设备上启动应用程序。

It installs the app on my iPhone but then before running it, throws this error:

它在我的 iPhone 上安装该应用程序,但在运行它之前,抛出此错误:

Process launch failed: Failed to get the task for process 216

进程启动失败:无法获取进程 216 的任务

This is how the Code Signing settings look like since the update:

这是自更新以来代码签名设置的样子:

enter image description here

在此处输入图片说明

Also checked Scheme and it runs in Debug configuration.

还检查了 Scheme,它在 Debug 配置中运行。

Is this a known issue with Mavericks? How to fix it?

这是小牛队的已知问题吗?如何解决?

回答by okysabeni

I got this error when signing it with a distribution profile. In my case, it was an Ad Hoc profile.

使用分发配置文件对其进行签名时出现此错误。就我而言,它是一个 Ad Hoc 配置文件。

It was confusing to me because you can't 'run' and install the app directly to your device if you sign it with a distribution profile. For my case, I use testflightapp and was able to upload the IPA.

这让我感到困惑,因为如果您使用分发配置文件对其进行签名,则无法“运行”并将该应用程序直接安装到您的设备上。就我而言,我使用 testflightapp 并且能够上传 IPA。

The error message is not very descriptive of the problem.

错误消息对问题的描述不是很清楚。

Also, if you are stuck, make sure you check the profiles for both the 'Project' and the 'Target'

此外,如果您遇到困难,请确保检查“项目”和“目标”的配置文件

回答by iamjustaprogrammer

Figured it out. My Developer Certificate was marked as "Expired" in Keychain (search Spotlight for "Keychain", then click on the "user" tab on the left). I deleted it, then went to Xcode > Preferences > Accounts, selected my ID and clicked on "View Details", then clicked the Update icon at the bottom left. Xcode re-installed the renewed certificate. Then I went to Build Settings and manually set the Debug configuration to use the Developer certificate Xcode just reinstalled for me.

弄清楚了。我的开发人员证书在钥匙串中被标记为“已过期”(在 Spotlight 中搜索“钥匙串”,然后单击左侧的“用户”选项卡)。我删除了它,然后转到 Xcode > Preferences > Accounts,选择我的 ID 并单击“查看详细信息”,然后单击左下角的更新图标。Xcode 重新安装了更新的证书。然后我转到构建设置并手动设置调试配置以使用刚刚为我重新安装的开发人员证书 Xcode。

回答by chenguang

I think you use the distribution profile, you can revise like this:

我认为您使用分发配置文件,您可以这样修改:

[enter image description here]

[ 在此处输入图片说明]

回答by Juan Boero

In my case I had to go to Keychain, lock/unlock or unlock/lock Login, there is something with the signing that looses state.

在我的情况下,我必须转到钥匙串,锁定/解锁或解锁/锁定登录,签名会丢失状态。