Separate entitlements for iPad and Catalyst

80 views Asked by At

I have a drawing app initially created for iPad. One of the features is a utility that uses core Bluetooth to help locate a misplaced Apple Pencil. This works on iPad but doesn't work on Catalyst since the pencil is paired with an iPad, not a Mac. The Mac version of my app was rejected because the entitlements listed Bluetooth. I've just resubmitted with that entitlement deleted, but I found no way to have it set for just iPad. Is there a way to do that? Or will I have to toggle the setting each time I alternate between iPad and Catalyst builds?

1

There are 1 answers

4
deniz On

There might be other ways to achieve this but one way comes to mind goes like this:

  1. Duplicate the existing entitlement file. Then remove the Bluetooth capability from this duplicate. Let's name this entitlement file myAppName-mac.entitlements.
  2. Go to Project settings of your app and then create another release configuration - let's call this new configuration Release-mac. Make this new configuration based on your current Release configuration.
  3. Now select your app target > Build Settings. In build settings, find the entry with the name "Code Signing Entitlements". You can now associate different entitlements with different release configurations. Go ahead and associate "myAppName-mac.entitlements" with your "Release-mac" configuration.
  4. Create a new scheme - let's name it myApp-mac. Select this scheme and edit it.

showing how to create a scheme in XCode

  1. You can associate this scheme with the new release configuration you created in Step 2. Do this for Run, Test, Profile, Analyze and Archive build variants.

showing how to associate scheme with a release configuration

  1. Now when you are ready to publish your app, select the appropriate scheme before running the archive job.