How to locate the entitlements plist file in an XCode 6.3 iOS project

本秂侑毒 提交于 2019-12-11 03:26:32

问题


I have a relatively complicated problem, described below for the context. The solution seems to boil down to editing the entitlements plist file manually.

I cannot find any entitlements.plist file in my project, and could not find any "entitlements" sections in other plist files I found.

The question is, how can I locate the entitlements plist file?


Now for the background story:

I need to create a new provisioning profile for an enterprise app we have deployed (the old one will expire shortly). There are several versions out there running in different environments (all with the same app ID). For some reason the current version of the app no longer includes the entitlement "com.apple.developer.team-identifier". When renewing the provisioning profile, this entitlement is automatically removed from the profile as well. This causes all the older versions of the app to stop working. They fail to start with this error in the console log:

entitlement 'com.apple.developer.team-identifier' has value not permitted by provisioning profile 'My Profile'

According to Apple Support, we have to update all those apps to the latest version, which of course is not possible since some are in production on older environments and are not all compatible with the newest capabilities. (We are not planning to give all customers a free upgrade either). So, Apple's official solution is not an option.

According to this comment on a related issue it should be possible to re-introduce the dependency on the missing entitlement. I figured that if I could add the entitlement to the current app, regenerate it and then generate a new provisioning profile for it, the problem might be solved.


回答1:


Answer

My app was using the default capabilities in which case there is no entitlements.plist file. I was able to add one by adding some capabilities in the UI (and then removing them again).

Follow up

In the end this did not solve my problem, which turned out to be different since this entitlement was already in the previously generated profile (with default capabilities). I only noticed this when comparing the generated profiles (they were identical).

The error in the console log seems to be caused by a difference in the plist:

Previous provisioning profile:

<key>com.apple.developer.team-identifier</key>
<array>
    <string>SomeIdentifier</string>
</array>

New provisioning profile:

<key>com.apple.developer.team-identifier</key>
<string>SomeIdentifier</string>

It may be possible to get the provisioning profile compatible again by adding an extra team-identifier so that it becomes an array again, but that's a different question that the one I asked here.



来源:https://stackoverflow.com/questions/30217716/how-to-locate-the-entitlements-plist-file-in-an-xcode-6-3-ios-project

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