Reputation: 16841
I need to submit my app to the App Store. So before I do this, I validated my application using Xcode's
validate process.
When submitting for Validation, it required a entitlement
file to be added to the project. I was unable to create this file so I dragged an entitlement
file from another project and included in mine. This entitlement
file did not contain any data in it (it was an empty file). However when I submitted it to validation through Xcode the validation passed successfully.
What I want to know is, What does a entitlement
file do (since the entitlement
file included in my project is empty) and will my app get rejected from appStore for dragging and dropping an entitlement
file from another project?
Upvotes: 3
Views: 8405
Reputation: 431
According to Apple Reference
Entitlements confer specific capabilities or security permissions to your app.
Specifically
Set entitlement values in order to enable iCloud, push notifications, and App Sandbox (App Sandbox is Mac OS X only). Each entitlement has a default value, which in most cases disables the capability associated with the entitlement. When you set an entitlement, you are overriding the default by providing an appropriate key-value pair
Entitlement file is just a plist file, you can see it as another setting file that include a few highlevel configuration and is essential for code-signing an adhoc build prior to xcode 4.x
Empty entitlement file is valid as XCode will treat empty entitlement file as you want to use all the default value specified by Apple's reference. Leaving an entitlement file in your app project won't cause any harm, unless you specify something that your app is not capable of , i.e. icloud storage. Better to just delete that file if you don't need local distribution. :)
According to Apple Technical Note TN2250 (I recommend you to get rid of the entitlement file)
If you are defining a custom Code Signing Entitlements file within your Target > Build Settings, you might try removing that configuration entirely and rebuilding/resubmitting. More often than not, Code Signing Entitlements are defined unnecessarily. You only need to specify a custom Code Signing Entitlements file if your application is utilizing custom keychain access sharing or iCloud. Otherwise, remove the Code Signing Entitlements configuration from all build configurations on your Xcode project's Target > Build Settings, the rebuild and reattempt your submission/validation.
Specifying a code signing entitlements file unnecessarily is the most likely cause of errors such as -
The app 'Foo' was not installed on the iPhone "foobar's iPhone" because the entitlements are not valid.
In most cases, those entitlements seen above should be the only entitlements in your App's Signature. Applications using Apple Push Notification or iCloud will add a couple entitlements. Otherwise, extra entitlements than those listed above, or improperly spelled, or formatted versions of those entitlements will likely result in "failed codesign verification" preventing upload to the store, or for Ad Hoc builds produce the iTunes installation error 'the application was not installed because the entitlements are not valid'.
Please see Reference
Upvotes: 6