Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entitlements / Capabilities per Xcode scheme

Tags:

xcode

ios

The Apple Pay entitlement / capability is only valid in the App Store. I am releasing this app in both the App Store and Enterprise.

  • If the App Store Release scheme is selected I'd like Xcode to enable the Apple Pay entitlement.
  • If the Enterprise Release scheme selected I'd like Xcode to disable the Apple Pay entitlement.
like image 484
volni Avatar asked Oct 06 '15 19:10

volni


People also ask

What are Xcode entitlements?

An entitlements. plist file is created per each provisioning profile (app executable) produced by Xcode during the application build step. If your secured app contains any Extensions or Frameworks, multiple entitlements files will be created by Xcode's build process and are required for the app signature.

How do I set entitlements in Xcode?

Select iOS > Resource > Property List. Name the new file " foo. entitlements " (typically, " foo " is the target name) Click the (+) next to "Entitlements File" to add a top-level item (the property list editor will use the correct schema due to the file extension)

How do I check my entitlements?

Check the Entitlements In Your Build Log and App You'll find the name of the provisioning profile Xcode used to sign your app in the invocation of the codesign tool's command-line parameters. This command prints a plist that contains all of the entitlements built into the app.

What is entitlement file in iOS?

Entitlements are special app capabilities and security permissions granted to applications that are correctly configured to use them. In iOS, apps run in a sandbox, which provides a set of rules that limit access between the application and certain system resources or user data.


1 Answers

A possible approach:

  1. Put your different schemes' entitlements files in a folder
  2. Have your project or target's Build Settings > Code Signing Entitlements point to a location such as $(PROJECT_DIR)/AppName/AppName.entitlements
  3. In Edit Scheme > Build > Pre-actions, add a "Run Script" action to copy the entitlements file for that scheme, to the location you specified in step 2. e.g. cp ${PROJECT_DIR}/entitlements/DevScheme.entitlements ${PROJECT_DIR}/AppName/AppName.entitlements
like image 84
funkybro Avatar answered Sep 27 '22 22:09

funkybro