我在OS X El Capitan上安装了Xcode 8。

我得到这个错误:

签署“目标”需要一个开发团队。在项目编辑器中选择一个开发团队。 在SDK“iOS 10.0”中,产品类型“应用程序”需要代码签名


当前回答

如果您仍然遇到这个问题,请单击测试并为它们选择一个团队。

其他回答

Xcode 11.4

点击:

你的项目 签约与能力 选择你的团队。

最近在Xcode 11 beta 2上出现了这个问题:

在左侧面板上选择您的项目 找到目标的“Signing & Capabilities”标签

如果你的目标没有“签名和能力”选项卡(在我的例子中只有测试目标有),打开你的项目的构建设置,点击“全部”而不是“基本”/“自定义”。在设置下找到签名,并确保您已经设置了开发团队。

如果需要,对测试目标重复相同的步骤

好吧,在我做了所有这些事情之后,我仍然有错误,所以我关闭Xcode,重新打开它,然后它就工作了。

在Xcode13中:在导航栏中选择你的项目->,你会看到TARGETS ->单击TARGETS ->下面的项目名称,你会看到Signing& Capabilities

要在真正的设备上运行你的应用,你需要有一个Apple ID,并用这个ID注册你的设备。这就是为什么您会得到这个错误。

你可以这样做。

Go to the project Navigator. Cmd-1 if you can't find it. Click the project target dropdown and pick Target. Click on the Team dropdown and pick add an account. Sign in with your Apple ID that is linked to your developer account, or just your Apple if you don't have a dev account. If you haven't registered your device with that account yet, a button will appear, something like 'Register device'. Click that and Apple will register the device and do the certificates and code signing. (Oh my unicorns certificates and signing is so much easier than it used to be)

选择您的物理设备并点击运行,它应该加载到您的设备上没有错误。