Entitlements.plist key/value pair for XCode project - ios

I have got User Assigned Device Name additional entitlement approved for my bundle ID and now need to use this in XCode project. I have successfully configured this additional capability in my AppId in developer portal, but I can not find anyway to import it in XCode project as highlighted in the portal:
Provisioning in Xcode with additional capabilities
In Xcode 13 and later, once the capability is enabled for your App ID, you can configure Xcode to support automatic signing.
In your app’s .entitlements file, add the assigned entitlement key and value pair.
Build your app on your device.
Xcode will detect the differences between your currently issued provisioning profile and the entitlements.plist, and request a new provisioning profile.
Problem is there is no entitlements.plist file for my target. And if I click on capabilities tab in Signing & Capabilities section, there is no key value pair to select for User Assigned Device Name. What am I supposed to do I wonder?

Related

renaming xcode project generates signing error

(new to xcode. need to change working project) I want to rename my xcode project, followed the instructions in https://help.apple.com/xcode/mac/11.4/#/dev3db3afe4f
but if I change the Identity|BundleIdentifier, The Signing section warns that "The provisioning profile does not match the ... bundle ID"
Where do I add new BundleIdentifier and how do I use it?
(my xcode version is 10.1)
From If the provisioning profile App ID doesn't match the bundle ID:
If there is a conflict between the App ID in the provisioning profile
and the bundle ID in your project, you receive error messages similar
to the following:
Code Sign error: Provisioning profile 'MyApp Profile' specifies the
Application Identifier 'com.mycompany.MyApp.*' which doesn't match the
current setting 'com.mycompany.MyApp' In the project editor, choose
the target and click General.
In the Identity section, set the bundle ID to match the App ID.
In the Signing section, verify that the team, provisioning profile,
and signing certificate settings are correct.
Next to the provisioning profile, click the information icon.
In the dialog that appears, verify that the provisioning profile
contains the correct App ID.
In addition, you can view the App ID and provisioning profile details
in your developer account.
The Xcode default is to generate a profile per app (ie. com.mypackage.myapp)
You can generate provisioning profiles for a package (ie com.mypackage.*), but this may require a paid developer account and may also require selecting it in the app settings.

Can't use the iOS distribution in Xcode

In my Xcode 9 project I have the Automatically manage signing checked. I want to sign the application with the iOS distribution certificate. For some reasons, when I was creating the certificate I entered the name and email of another person. In the keychain Access I can see the public and private keys with the name of that person and under the private one, the iPhone distribution certificate. The problem is that in Xcode when I select the Team, I'm only getting the iPhone developer signing certificate and not the the distribution one. But from the Build Setting I can see the iPhone distribution in the select list of the Code Signing Identity. Once I select it, Xcode detect a conflict of the provisioning profile (because I change it manually and the Automatically manage signing is checked). I tried the solution of check then uncheck it and select the team but the problem is still here.
Make sure your Scheme under the Left top corner of App name Dropdown-->Edit Scheme is enabled to Release and not Debug for Archive and Testing also so automatically your Distribution is selected.
When you use the Automatic provisioning by default you are getting two profiles generated in Xocde One when you connect the device it used Dev Profile for debugging, but when you archive the build it autogenerates Distribution profile. If you have enterprise account, I would recommend having a universal distribution profile created and not Adhoc as it will always have to be updated with new Device ID added to be regenerated and recompiled the old app.
you just uncheck "Automatically signing" option. Once you uncheck only profile selection option will be enabled. Select distribution profiles as shown in image.

Invalid provisioning profile when submitting WatchKit extension?

I am trying to submit our app with a WatchKit extension now that Apple is allowing 3rd party developers to do so. However everytime we try to submit through Application Loader we are greeted with the following error message:
Invalid provisioning profile. The provisioning profile included in the bundle bundleidentifier.watchkitapp is invalid. [Missing code-signing certificate.] For more information, visit the developer portal.
We have set up the provisioning profile just like we have done before without any problems. We have App ID's for bundleidntifier (Companion app), bundleidntifier.watchkitextension (WatchKit extension) and bundleidntifier. bundleidentifier.watchkitapp (WatchKit app) with corresponding distribution provision profiles.
We think the problem lies in the WatchKit app target. In Xcode there is no Build Settings tab when the WatchKit app target is selected thus we cannot assign the provision profile we created.
We have also tried using a WildCard ID and Provision profile with the same error being generated. Where are we going wrong?
Following steps help me out: 1.Make sure "App Groups" in Capabilities page in Container target and Extension target.
2.Goto Xcode > Preferences > Accounts > YOUR_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash.
3.Open "App Groups" in Container target and Extension target. Xcode will generate two profiles for you, just like iOSTeam Provisioning Profile: YOURAPPID and iOSTeam Provisioning Profile: YOURAPPID.watchkitextension. (Make sure your container target and WatchKit App target choose the first one as PP,and your extension target choose the second one).
4.Maybe you need to regenerate your "Distribution Profile" in Developer Member Center.
5.If everything goes well, you can do whatever build, run and submit.
We managed to fix it by setting the code signing settings at the project level instead of the target level.

Does enabling Keychain Sharing alter your AppID?

I notice when I enable Keychain Sharing in Xcode for my iOS app Xcode says it will "Add the Keychain Sharing entitlement to your App ID", and it does appear to connect to my account because I get a popup asking which developer account to use. However on the dev portal there's no visible change to any of my App IDs, and my provisioning profile isn't invalidated like it sometimes is when I change an app's entitlements. Keychain Sharing isn't a visible option to enable/disable in the App ID, either.
Does anyone know what Xcode is doing under the covers here? The local change to the entitlements file is obvious, but I'd like to understand the App ID side of it.
Every keychain item in iOS contains an attribute called the keychain access group. An iOS app can only access those keychain items it has permission to. This permission comes from the code signing entitlements stamped into the app when it is signed.
By default, an app can only access keychain items with the keychain access group matching the application-identifier code signing entitlement. However, if a developer wants to share keychain items amongst their apps, they can add a custom keychain-access-groups code signing entitlement that specifies an array of keychain access groups that the app can access.
Normally one creates keychain items without setting the access group attribute kSecAttrAccessGroup. In that case, Keychain Services will automatically set that attribute to the default value. If there is no keychain-access-groups entitlement, the default is the value of the application-identifier entitlement. Otherwise the default is the value of the first array element in the keychain-access-groups entitlement.
When using the Xcode Capabilities editor on the target settings pane to turn on Keychain Sharing, Xcode will add the required App ID Prefix (Team ID) to the front of any listed Keychain Group items at build time. You can see that in the generated entitlements file represented by the build setting $(AppIdentifierPrefix).

Setting an Entitlements file - The executable was signed with invalid entitlements

As soon as I check "Use Entitlements File" in Xcode, I get the following error when I try to run my app on my phone:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements
file do not match those specified in your provisioning profile.
I'm trying to get iCloud working, and it seems like I'm failing on step 1. I can run in the emulator, but not in the device I provisioned automatically through the organizer.
What am I doing incorrectly here?
First of all, you need to have specific provisioning for your App's ID, matching its bundle ID. Even if it's only for development, generic Team Provisioning cannot work to test iCloud.
If the App ID had been issued without iCloud enabled, and updated afterward, related Provisioning must be updated also.
Often, provisioning updating from Xcode's organizer fails to bring the right one. In this case, I suggest you to try to download updated provisioning directly from iOS Developer Website.
In my case, I have added inter-app capability in my iOS project and Xcode automatically suggested to add this permission in the app id (bundle id) in the provisioning portal and I did so. After this
I thought it was fixed since Xcode was showing tick marks for all under inter-app audio sections as follows
Add the "Inter-App-Audio" entitlement to your APP ID
Add the "Inter-App-Audio" entitlement to your entitlements file
Link AudioToolbox.framework.
Actually it was not fixed and I had to generate another distribution certificate with inter-app enabled and only when I signed with that distribution certificate I was able to install the app.
You Need to have Developer Certificate And Private Key in your keychain And Provision profile that have created must match with this Certificate.

Resources