Code signing error when building an application with login item on xcode cloud

When building xcode project of an application with login item included/embedded (another target), locally it works without problems. But when building on xcode cloud, we are getting the error:

ITMS-90286: Invalid code signing entitlements - Your application bundle’s signature contains code signing entitlements that aren’t supported on macOS. Specifically, the “XXX.***.***” value for the com.apple.application-identifier key in “Path_to_login_Item” isn’t supported. This value should be a string that starts with your Team ID, followed by a dot (“.”), followed by the bundle ID.

If there are no capabilities added to the login item's target (only com.apple.security.inherit and App Sandbox), the project builds without errors. But our login item needs to access a database in app group container and sync its data with iCloud, so after adding iCloud and App Group entitlements, building on xcode cloud fails with the error written above. Locally it builds and runs without problems.

So, what should be done to fix this issue when building on xcode cloud?

How are you installing your login item? Using SMAppService? Or the legacy SMLoginItemSetEnabled?

What target type are you using for the login item? That is, did you start with the macOS > Command Line Tool template? Or the macOS > App template?

What does the bundle structure look like? I’d expect to see something like this:

MyApp.app/
    Contents/
        MacOS/
            MyApp
        Library/
            LoginItems/
                MyLoginItem.app/
                    Contents/
                        MacOS/
                            MyLoginItem

This is required by SMAppService and further explained in Placing Content in a Bundle.

Is that what you’re doing? Or something else?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am installing it using SMAppService

Its target type is MacOS -> App

Yes, the structure looks exactly this. (I am copying login item using Build Phases -> Copy Files in the main App)

Everything works without a problem when building locally - login item is being launched, it can access app group container and iCloud. Just xcode cloud build returns strange error about application-identifier. And I cannot find out why.

Code signing error when building an application with login item on xcode cloud
 
 
Q