Search code examples
iosmacosxcode8entitlementscode-signing-entitlements

Are macOS and iOS targets supposed to share the same entitlement file?


I have a project that has a target for iOS and macOS. When I was adding the iCloud capability to the iOS project and I ran it, I received an error that my entitlements file contained invalid or not permitted entitlements. When I went to the build settings I noticed that my iOS target was using the same entitlement file as the macOS target.

Are both targets supposed to use the same entitlement file or should they each have their own?


Solution

  • No, different targets should, in principle, have different entitlements.

    I had the same problem once, and unfortunately had to use different filenames for each target's entitlements file, or else Xcode would get them all mixed up.

    You can set the entitlements file in each target's Build Settings.