skip to Main Content

I have a Capacitor app that I am trying to build through DevOps with the xcode@5 task. However, I am not getting an .ipa to be generated on completion of the task. What am I missing? Is there another task that I need to run after the xcode task?

  - task: Xcode@5
  inputs:
    actions: 'build'
    scheme: 'App'
    sdk: 'iphoneos'
    configuration: 'Release'
    xcWorkspacePath: '**/App.xcworkspace'
    xcodeVersion: 'default'
    packageApp: true
    signingOption: 'manual'
    provisioningProfileUuid: 'xxxxxx-xxxxx-xxx-xxx-xxxxxxxxx'
    archivePath: "$(System.DefaultWorkingDirectory)/archive"

2

Answers


  1. It seems you didn’t set the Signing identity input in your task.

    An Xcode app must be signed and provisioned to run on a device or be published to the App Store. This requires a P12 signing certificate and at least one provisioning profile. The tasks ‘Install Apple Certificate’ and ‘Install Apple Provisioning Profile’ are designed to provide Xcode with these essentials during the build process.

    - task: InstallAppleCertificate@2
        inputs:
          certSecureFile: 'my-secure-file.p12' # replace my-secure-file.p12 with the name of your P12 file.
          certPwd: '$(P12password)'
    - task: InstallAppleProvisioningProfile@1
        inputs:
          provProfileSecureFile: 'my-provisioning-profile.mobileprovision' # replace my-provisioning-profile.mobileprovision with the name of your provisioning profile file.
    - task: Xcode@5
      inputs:
        signingOption: 'manual'
        signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
        provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
    

    After this, you can check the archive path parameter for Xcode task. The ipa file is placed in the folder defined in archive path. You can add the Copy Files and Publish Build Artifacts tasks to store your IPA with the build record or test and deploy it in subsequent pipelines.

    - task: CopyFiles@2
      inputs:
        contents: '**/*.ipa'
        targetFolder: '$(build.artifactStagingDirectory)'
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'drop'
        publishLocation: 'Container'
    

    Please refer this document Build, test, and deploy Xcode apps and Sign your Apple iOS, macOS, tvOS, or watchOS app to learn how to build and deploy Xcode projects with Azure Pipelines.

    Login or Signup to reply.
  2. To generate the IPA package, you need to use .P12 certificate file and Provisioning Profile to sign the package.

    Here are the steps:

    Create certificate

    Step1: Sign in the developer.apple.com/account/resources and select the Certificates tab.

    Step2: Create a new certificates or select an existing certificate. Then download it(.cer file) to your local machine.

    Step3: Double click the .cer file to install the certificate and navigate to Keychain Access(mac local machine) to find newly installed certificate.

    Step4: Export the .P12 file and set the password.

    Create provisioning profile

    Step1: Sign in the developer.apple.com/account/resources and select Profiles tab.

    Step2: Create a new Profiles. Select IOS App Development -> Apple ID as before.

    Step3: When you select the certificate, you need to select the corresponding certificate downloaded in the previous step.

    This is the key step. You need to select the same certificate as the .p12 file created.

    For example:

    enter image description here

    Step4: Download the Provisioning Profile.

    Finally, you could upload the new XX.p12 file and Provisioning Profile to Azure Devops Secure file(Pipelines -> Library -> Secure files). Then you could use them in pipeline.

    For example:

    steps:
    - task: InstallAppleCertificate@2
      inputs:
        certSecureFile: 'my-secure-file.p12' 
        certPwd: '$(P12password)'
    - task: InstallAppleProvisioningProfile@1
      inputs:
        provProfileSecureFile: 'my-provisioning-profile.mobileprovision' 
    - task: Xcode@5
      inputs:
        actions: 'build'
        scheme: 'App'
        sdk: 'iphoneos'
        configuration: 'Release'
        xcWorkspacePath: '**/App.xcworkspace'
        xcodeVersion: 'default'
        packageApp: true
        signingOption: 'manual'
        signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
        provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
        archivePath: "$(System.DefaultWorkingDirectory)/archive"
    

    Note: certSecureFile and provProfileSecureFile are the .p12 and .mobileprovision file Name attribute in Secure Files.

    The certPwd is from the Pipeline variable or Variable Group. It will save the password you set at the #Create certificate step.

    Result:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search