I have tried multiple things in Azure DevOps (VSTS) to create CI for the iOS app but turns out that Azure DevOps doesn't support the apps that have App extensions. Is it really the case?
I'm using the OneSignal Notification Service Extension in our project which is dependent on the main target. So, when Xcode task tries to sign the app an error occurs related to the build identifiers as the Xcode main target has a different build identifier than OneSignalNotificationServiceExtension's build identifier.
❌ error: Provisioning profile "MainTargetName" has app ID "com.xyz.-", which does not match the bundle ID "com.xyz.-.OneSignalNotificationServiceExtension". (in target 'OneSignalNotificationServiceExtension' from project 'ProjectName')
I'm using an apple certificate task to install the certificates on the Microsoft hosted agent and similarly using the provisioning profile task to install the provisioning profiles. It looks like the Xcode task has a limitation that it cannot get multiple provisioning profiles so it can cater to those iOS apps with App Extension.
- task: InstallAppleCertificate@2
displayName: 'Install Certificates'
inputs:
certSecureFile: '3Certificates.p12'
certPwd: '$(P12Password)'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install MainTarget provisioning profile'
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'MainTarget.mobileprovision'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install OneSignal provisioning profile'
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'OneSignal.mobileprovision'
- task: CmdLine@2
displayName: 'CocoaPods install'
inputs:
script: |
cd $(Build.SourcesDirectory)
echo "Pod installation"
pod install
- task: Xcode@5
displayName: 'Xcode Build'
inputs:
actions: 'build'
xcWorkspacePath: 'CICD.xcworkspace'
scheme: 'CICD'
xcodeVersion: 'specifyPath'
xcodeDeveloperDir: '/Applications/Xcode_11.2.1.app'
packageApp: true
exportOptions: 'plist'
exportOptionsPlist: 'CICD/Info.plist'
signingOption: 'manual'
signingIdentity: '$(MY_CERTIFICATE_SIGN_IDENTITY)'
provisioningProfileUuid: '$(MainTarget_ProfileUUID)'
provisioningProfileName: '$(MainTarget_ProfileName)'
Let me know if I'm missing something here.