Debug rows missing from Code Signing and Provisioning Profile sections

≡放荡痞女 提交于 2020-01-25 20:26:08

问题


The problem:

With All/Combined selected from the top menu within either the Project or the Target, this is what I see. Debug used to be listed within the Provisioning Profile and Code Signing Identity sections, but it is now missing. I can build a run on the simulator like this but when trying to deploy to a tethered testing device I get errors about provisioning profile and code signing being required.

This is not a duplicate of 'Provisioning profile' options missing from 'Code signing' Xcode 6.3 because I have All/Combined selected. It's not just that Debug is not visible in the list... it doesn't even exist anymore in the project.pbxproj file that Xcode uses to build the list.

What caused it:

I was trying to remove a profile in Xcode 7.3.1 and pressed the delete key without realizing the root debug row was selected rather than the child row which holds the profile itself. I can add a child (e.g. a release type such as Any iOS SDK) to a Release or Debug row by hovering over the parent row and clicking the +, but I can't add a new root item like Debug that way. No + is available when hovering over the Code Signing or Provisioning Profile rows. Unfortunately, while I can't remove one of these root rows with the mouse (no - button on them), I can accidentally do so with the delete key – which is what led to this broken state.

What I've tried:

Cleaning, restarting Xcode and computer, reinstalling Xcode, upgrading to Xcode 8, migrating to Swift 2.3, migrating to Swift 3, etc. I used a text editor with JSON syntax highlighting to opened multiple versions of the project.pbxproj file (some before the deletion) to see the differences. The project.pbxproj file is used to generate the menu items for the project and target. The old version is missing many new settings for the Release section found in the new version now that it has gone through several upgrade iterations with Xcode and Swift migrations. Among other concerns with that file, I wouldn't even know what was missing from the Debug section I'd be trying to add back. I could start a fresh project and copy over the Debug section from it's project.pbxproj file, but I'm convinced that manually editing that file to try to add the debug items back is a bad idea. There's probably a better option.

Question:

What's the best way to restore the missing Debug menu items?


回答1:


What I would suggest is to create "manually" the new Debug configuration. You will not restore your old configuration but you will be able to set the correct configuration for the Debug configuration.

The operation is described in Adding a build configuration in Xcode but in your case you will have to duplicate the Release configuration and edit it to fit your requirements.

I also guess you will have to edit your schemes to use the correct configuration for each action (build/run/...).



来源:https://stackoverflow.com/questions/39895646/debug-rows-missing-from-code-signing-and-provisioning-profile-sections

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!