Hi Martijn Kuypers,
Azure DevOps Pipelines Slower After Upgrading to macOS 14 + Xcode 16.1
This is primarily due to the fact that Microsoft-hosted macOS agents in Azure DevOps currently run on Intel-based Mac Pros, while Xcode 16 is optimized for Apple Silicon (ARM64). Unfortunately, macos-14-arm64
runners are not supported on Azure DevOps, they are only available on GitHub Actions.
Try the Below Workaround to Fix Build Times:
Enable Build Caching to Offset Delay
Caching Swift packages and DerivedData
helps reduce rebuild times between runs. Add the following to your Azure DevOps YAML pipeline:
trigger:
- main
pool:
vmImage: 'macos-14'
variables:
derivedDataPath: '$(Agent.TempDirectory)/DerivedData'
swiftPackageCache: '$(Agent.TempDirectory)/SwiftPackages'
steps:
- task: Cache@2
inputs:
key: 'derivedData | "$(Build.SourcesDirectory)"'
path: '$(derivedDataPath)'
restoreKeys: |
derivedData
- task: Cache@2
inputs:
key: 'swiftPackages | "$(Build.SourcesDirectory)/Package.resolved"'
path: '$(swiftPackageCache)'
restoreKeys: |
swiftPackages
- script: |
bundle install
displayName: 'Install Ruby Gems'
- script: |
bundle exec fastlane your_lane_name derived_data_path:$(derivedDataPath) build_path:$(swiftPackageCache)
displayName: 'Run Fastlane Build'
Replace your_lane_name
with actual Fastlane lane.
Update paths based on how Fastlane is configured in your project (derived_data_path
, build_path
).
For more details, please refer this Microsoft documentation: Azure Pipelines Cache Task
Try GitHub Actions (macos-14-arm64) for Benchmarking
If you're open to testing GitHub Actions, it supports Apple Silicon runners, which are often significantly faster for Xcode 16 workloads.
name: Build with Xcode 16 (ARM64)
on: [push]
jobs:
build:
runs-on: macos-14-arm64
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bundle install
- name: Build with Fastlane
run: bundle exec fastlane your_lane_name
Github Runner Reference: GitHub Actions macOS ARM64 Runner
Consider Self-Hosted macOS Agents for Maximum Performance
If build time or reliability is a major concern, consider running your own self-hosted Mac mini (M1 or M2) as a build agent. This eliminates the architecture mismatch and can greatly reduce build duration.
Please refer this Microsoft documentation: Deploy self-hosted macOS agent
Hope it helps!
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.