Skip to content
Latchkey

MAUI iOS "Xcode ... not found / could not find Xcode" in CI

A MAUI iOS build must run on a macOS runner with Xcode installed and selected. If Xcode is missing, not selected with xcode-select, or the build runs on Linux, the iOS target fails because the Apple toolchain is unavailable.

What this error means

A MAUI iOS build fails reporting that Xcode could not be found, that no developer directory is selected, or that the iOS workload cannot run on a non-macOS runner.

Xamarin.iOS
error : Could not find a valid Xcode installation. Xcode is required to build for iOS.
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory is a CLT instance.

Common causes

Building iOS on a non-macOS runner

iOS targets require macOS and Xcode. Running the iOS build on a Linux or Windows runner has no Apple toolchain.

No Xcode selected on the macOS runner

Xcode is installed but the active developer directory points at the command line tools, not a full Xcode, so xcodebuild is unavailable.

How to fix it

Run on macOS and select Xcode

  1. Use a macos-* runner for the iOS target.
  2. Select a full Xcode with xcode-select.
  3. Build the iOS target framework.
.github/workflows/ci.yml
runs-on: macos-14
steps:
  - run: sudo xcode-select -s /Applications/Xcode_15.4.app
  - run: dotnet build -f net8.0-ios -c Release

Split iOS into its own macOS job

Keep Android/Windows targets on their runners and build iOS only on macOS so each platform has its toolchain.

.github/workflows/ci.yml
strategy:
  matrix:
    include:
      - { os: macos-14,    tfm: net8.0-ios }
      - { os: ubuntu-24.04, tfm: net8.0-android }

How to prevent it

  • Build iOS targets only on macOS runners.
  • Select a full Xcode with xcode-select before building.
  • Keep the selected Xcode version in sync with the iOS workload.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →