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.