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"
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:
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: