Azure DevOps Two Provisioning Profiles for iOS App

Viewed 963

I am very lost and haven't been able to find a huge amount of material on this matter.

I am creating a CI/CD pipeline for an iOS app that has two provisioning profiles, one for the main app and an additional one for widgets. I am installing both provisioning profiles, one after another like this:

- task: InstallAppleProvisioningProfile@1
  inputs:
   provisioningProfileLocation: 'secureFiles'
   provProfileSecureFile: '$(provisioningProfile)'
   removeProfile: true
  displayName: "Install Main Provisioning Profile"

- task: InstallAppleProvisioningProfile@1
  inputs:
   provisioningProfileLocation: 'secureFiles'
   provProfileSecureFile: '$(provisioningProfileWidgets)'
   removeProfile: true
  displayName: "Install Widget Provisioning Profile"

But when I run the Xcode task, I am failing with the error:

error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "[team id]" with a private key was found.

I am assigning provisioning profiles through a plist which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>provisioningProfiles</key>
        <dict>
            <key>[main app]</key>
            <string>[uuid]/string>
            <key>[widgets]</key>
            <string>[uuid]</string>
        </dict>
        <key>signingCertificate</key>
        <string>iOS Distribution</string>
        <key>signingStyle</key>
        <string>manual</string>
        <key>method</key>
        <string>app-store</string>
        <key>teamID</key>
        <string>[team id]</string>
    </dict>
    </plist>

My Xcode task looks like this:

- task: Xcode@5
  inputs:
    actions: '-allowProvisioningUpdates clean build'
    scheme: '$(scheme)'
    sdk: '$(sdk)'
    configuration: '$(configuration)'
    xcWorkspacePath: '$(workspace)'
    xcodeVersion: 'default'
    packageApp: true
    signingOption: 'manual'
    exportOptions: 'plist'
    exportOptionsPlist: '$(devPlist)'
  displayName: "Build and Sign"

If I change signingOption to 'auto' I get the error above and other's such as:

No profiles for '*****' were found: Xcode couldn't find any iOS App Development provisioning profiles matching '******'.
error: There are no accounts registered with Xcode. Add your developer account to Xcode

I've been on this for a couple of days, but every tutorial just seems to be using a single provisioning profile, and I'm really stumped on what to do next, so any help would be greatly appreciated.

This is the tutorial I have been trying to follow as much as possible, https://damienaicheh.github.io/ios/azure/devops/2019/12/05/build-sign-your-ios-application-using-azure-devops-en.html, and this is where I got the plist idea from, Azure Devops Pipelines - Xcode project with multiple provisioning profiles fails archive and sign.

Thanks

1 Answers

I was searching through the internet for couple of days without any results.

After a week of investigation I figured out that problem in my case was related to the configurations in my project: I was needed to set Signing as Apple Distribution for Release configuration in Build Settings both for app and extension

Example: Manual signing

Second think is related to pipelines configuration.

I did exactly the same as this guy How to create plist file with profiles recommended, but for me "Signing style" worked only with "Project Defaults":how to setup Xcode task

Note: It is very important to correctly configure your export option plist file.

I hope it will help and make someone's life easier.

Related