Xcode 8 找不到代码签名

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

Xcode 8 no code signature found

iosxcodecode-signingxcode8build-settings

提问by Martin Polak

After I upgraded to Xcode 8, I am unable to debug on the device due to the following error:

升级到 Xcode 8 后,由于以下错误,我无法在设备上进行调试:

App installation failed. No code signature found.

My setup, observations and what I've tried so far:

我的设置、观察以及到目前为止我尝试过的:

  • The device has iOS 10 installed
  • Code signing and debugging on the device in Xcode 7 works (no changes made to the code signing)
  • The app has a watch app (build/run without watch app didn't change anything)
  • Refreshing provisioning profiles, removing all of them and redownloading them didn't change anything
  • Removing ALL code signing setup from the build settings and enabled "automatically manage signing", which also didn't help
  • I'm always cleaning the build folder
  • I've tried restarting the device, xcode, the mac
  • My colleague reports the same issue with the same project
  • I've tried reverting the changes Xcode 8 suggested (build settings, warning fixes, ...)
  • 该设备已安装 iOS 10
  • Xcode 7 设备上的代码签名和调试工作正常(代码签名未做任何更改)
  • 该应用程序有一个手表应用程序(在没有手表应用程序的情况下构建/运行没有改变任何东西)
  • 刷新配置文件,删除所有配置文件并重新下载它们没有任何改变
  • 从构建设置中删除所有代码签名设置并启用“自动管理签名”,这也无济于事
  • 我一直在清理构建文件夹
  • 我试过重启设备、xcode、mac
  • 我的同事在同一个项目中报告了同样的问题
  • 我已经尝试恢复 Xcode 8 建议的更改(构建设置、警告修复等)

回答by user2031805



older answer is wrong

旧答案是错误的

I got the same problem here, I have five project, and the four of them can not debug on device and only one can debug on device. I compared the Xcode project files and did not figure it out. I believe it is a provisioning profile issue. it seem that the Xcode will generate the development provisioning profile in your Xcode and did not upload it to your apple developer account.

我这里遇到同样的问题,我有五个项目,其中四个不能在设备上调试,只有一个可以在设备上调试。我对比了Xcode工程文件,没搞清楚。我相信这是一个配置文件问题。Xcode 似乎会在您的 Xcode 中生成开发配置文件,但并未将其上传到您的 Apple 开发人员帐户。



update:

更新:

I finally solve my problem, it seems like a third framework manual set the codesign identity or privisioning profile in the signing seciton of build setting. then you install this third framework, in the codesigning phase, Xcode will search the non-existing codesign identity or privisioning profile for this framework, then it failed.

我终于解决了我的问题,似乎第三个框架手册在构建设置的签名部分中设置了协同设计标识或权限配置文件。然后你安装第三个框架,在协同设计阶段,Xcode 会搜索这个框架不存在的协同设计标识或配置文件,然后它失败了。

回答by Martin Polak

I was finally able to solve it with the following:

我终于能够通过以下方式解决它:

  • Update carthage(0.18 is currently the latest version). For some reason the code signing was not applied correctly.
  • In build settings set PROVISIONING_PROFILEandPROVISIONING_PROFILE_SPECIFIERboth to the same and correct profile
  • I had to disable automatically manage signing
  • 更新carthage(0.18 目前是最新版本)。由于某种原因,代码签名没有正确应用。
  • 在构建设置中设置PROVISIONING_PROFILE并且PROVISIONING_PROFILE_SPECIFIER都设置为相同且正确的配置文件
  • 我不得不禁用 automatically manage signing

In conclusion, all my provisioning profiles were correct and the problem was only related to code signing the frameworks and not to the app itself. If the error message would have stated where specifically No code signaturecould have been found, it would have saved quite some debugging time...

总之,我所有的配置文件都是正确的,问题只与框架的代码签名有关,与应用程序本身无关。如果错误消息会说明No code signature可以找到的具体位置,它将节省相当多的调试时间......

回答by johndpope

presumably you're using cocoapods? I had to manually set 'Automatic manage signing' & respective team then it finally worked. Thanks for the pointers from other commenters. For me - there's two development Teams working on same project - so not sure this solution is going to be best. Need to find way to do this at Podfile level.

大概你在使用可可豆?我不得不手动设置“自动管理签名”和相应的团队,然后它终于奏效了。感谢其他评论者的指点。对我来说 - 有两个开发团队在同一个项目上工作 - 所以不确定这个解决方案是最好的。需要找到在 Podfile 级别执行此操作的方法。

enter image description here

在此处输入图片说明

N.B. I'm on cocoapods - 1.2.0

注意我在 cocoapods 上 - 1.2.0

UPDATE - try this / edit Podfile and add to bottom. run Pod install

更新 - 试试这个/编辑 Podfile 并添加到底部。运行 Pod 安装

installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
end

IF THE ABOVE DOESN'T WORK - ONLY try this ( you may need to adjust to latest SDK eg. iPhoneOS10.2.sdk n.b. P.S. some body said they had to run PlistBuddy as sudo /usr/libexec/PlistBuddy)

如果以上不起作用 - 仅尝试此操作(您可能需要调整到最新的 SDK,例如 iPhoneOS10.2.sdk nb PS 有人说他们必须以 sudo /usr/libexec/PlistBuddy 的身份运行 PlistBuddy)

killall Xcode

/usr/libexec/PlistBuddy -c "Set :DefaultProperties:CODE_SIGNING_REQUIRED NO" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist\n
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:AD_HOC_CODE_SIGNING_ALLOWED YES" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist\n

/usr/libexec/PlistBuddy -c "Set :DefaultProperties:CODE_SIGNING_REQUIRED NO" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/SDKSettings.plist\n
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:AD_HOC_CODE_SIGNING_ALLOWED YES" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/SDKSettings.plist\n

 xcodebuild clean build