Home > Net >  Adding Apple Account to XCode in Azure Pipeline
Adding Apple Account to XCode in Azure Pipeline

Time:11-05

I'm currently facing a problem with signing a Flutter App within a pipeline. The main problem is that i do not have access to the private key of our iOS_Distribution certificate nor do i have the permission to create a new one and use it in a provisioning file. So manual signing is off the table. I think the only solution would be to run the xcodebuild with -allowProvisioningUpdates to somehow imitate the local build process of a XCode managed provisioning file. But obviously XCode needs a developer account assigned in the preferences to be able to create a provisioning file. That leads to my problem of adding the Apple Developer Account to the pipeline and to XCode within the pipeline. I just can't get it to work properly. I thought to use the Apple App Store Service Connection but can't figure out if XCode will even recognize the credentials. I'm just kind of lost. Is there any way to use automatic provisioning updates in a pipeline by adding the Apple account?

What I tried: I tried manual and automatic code signing via the XCode Task in Azure Pipeline. Both failed because the Provisioning Profile didn't match the certificate (because I'm not allowed to access it) or there was no account associated with XCode. I tried uploading an XCode generated provisioning file, but was prompted with the same error of no account being added to XCode. I called the team responsible and asked if there was any way to get the .p12 of the certificate. The answer was no. I'm kind of hoping for a magical solution to enable auto provisioning and adding the apple account :)

CodePudding user response:

So I’ve sort of found a workaround. It turns out that uploading the XCode-generated provisioning file wasn't so far off. I uploaded it to the Secure Files along with the Certificate used for it. Now I can use automatic signing. But what I was missing was the ExportOptions.plist.

The tag that's the deciding factor is:

<key>method</key>
    <string>development</string>

Instead of app-store distribution, development is used. This allowed me to build the IPA like I would normally like this:

- task: Xcode@5
        displayName: Building iOS App
        inputs:
          actions: 'build'
          scheme: 'Runner'
          sdk: 'iphoneos'
          configuration: 'Release'
          xcWorkspacePath: '**/*.xcworkspace'
          packageApp: true
          exportOptions: 'plist'
          exportOptionsPlist: 'path-to-exportoptions'
          exportPath: '$(Build.ArtifactStagingDirectory)/iOS'
          signingOption: 'auto'
          teamId: 'team-id'
  • Related