Pipelines 15-20 minutes slower after upgrading to macos 14 + xcode 16

Martijn Kuypers 0 Reputation points
2025-04-29T07:59:41.9366667+00:00

Last week we updated our pipelines to use macos 14 and xcode 16.1.

We noticed that our pipelines now take at least 15 minutes longer up tot 20.
especially the xcode build step is taking at least 10 minutes longer than before.

Which is weird because I do not notice this difference when building locally with either xcode 15 or 16 using the same fastlane lane.

We use fastlane to build and deploy.

Occasionally our pipeline also completely times out.

Has anyone encountered the same and how did they optimize this?

Azure DevOps
{count} votes

1 answer

Sort by: Most helpful
  1. Gaurav Kumar 785 Reputation points Microsoft External Staff Moderator
    2025-06-02T09:30:04.7366667+00:00

    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.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.