I’m trying to build and archive an iOS project in an Azure DevOps pipeline, but the build keeps failing with return code 65 when running the Xcode@5 task.
The project structure:
- Root repo contains CI/CD config (azure-pipelines.yml)
- iOS project (Core.xcworkspace) is a Swift native app that uses submodules
- CocoaPods are used for dependency management
Here’s the relevant error snippet from the pipeline logs:
** ARCHIVE FAILED **
The following build commands failed:
Archiving workspace NexoCore with scheme NexoCore
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
My pipeline YAML (relevant parts):
jobs:
- job: ios
pool:
vmImage: 'macOS-latest'
variables:
configuration: "Release"
sdk: "iphoneos"
scheme: "Core"
system.debug: true
derivedData: "DerivedData"
outputDir: "$(build.artifactStagingDirectory)"
steps:
- checkout: self
submodules: recursive
- script: |
gem install cocoapods --no-document
pod install --repo-update
displayName: "Install CocoaPods"
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'AppCetificate.p12'
certPwd: $(appCertificatePassword)
keychain: 'temp'
deleteCert: true
- task: InstallAppleProvisioningProfile@1
inputs:
provProfileSecureFile: 'IOSProvisioningProfile.mobileprovision'
removeProfile: true
- task: Xcode@5
inputs:
actions: 'clean archive'
configuration: '$(configuration)'
sdk: '$(sdk)'
xcWorkspacePath: 'Core.xcworkspace'
scheme: '$(scheme)'
xcodeVersion: 'specifyPath'
xcodeDeveloperDir: '/Applications/Xcode_16.4.app'
packageApp: true
signingOption: 'manual'
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
args: '-derivedDataPath $(derivedData) -destination "generic/platform=iOS"'
What I’ve tried:
- Verified the provisioning profile and certificate are uploaded correctly in DevOps
- Confirmed that submodules are checked out (submodules: recursive)
- Ran pod install with --repo-update to make sure Pods are up to date
- Explicitly set Xcode version (/Applications/Xcode_16.4.app)
- Used -destination "generic/platform=iOS"
Still, the archive step fails with code 65.
I installed CocoaPods with pod install --repo-update, checked out submodules, and set up signing using certificate + provisioning profile tasks. I expected the Xcode@5 task to archive the workspace and generate an .ipa file, but instead it fails with xcodebuild return code 65 during the archive step.
ERROR LOG:
Build description path: /Users/runner/work/.../XCBuildData/abc.xcbuilddata
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'SomeLib' from project 'Pods')
/Users/runner/work/.../Pods/Pods.xcodeproj: error: Pods-ABC does not support provisioning profiles.
Pods-ABC does not support provisioning profiles, but provisioning profile ABCProvisioningProfile has been manually specified.
Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Pods-ABC' from project 'Pods')
/Users/runner/work/.../SharedKit/SharedKit.xcodeproj: error: SharedKit does not support provisioning profiles.
SharedKit does not support provisioning profiles, but provisioning profile ABCProvisioningProfile has been manually specified.
Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'SharedKit' from project 'SharedKit')
/Users/runner/work/.../Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0,
but the range of supported deployment target versions is 12.0 to 18.5.99. (in target 'Alamofire' from project 'Pods')
** ARCHIVE FAILED **
The following build commands failed: Archiving workspace ABC with scheme ABC (1 failure)

xcodebuildcommand so that we can help you.