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.

Frequently asked questions

What causes "iOS "Xcode ... not found""?
iOS targets require macOS and Xcode. Running the iOS build on a Linux or Windows runner has no Apple toolchain.
How do I fix iOS "Xcode ... not found"?
Run on macOS and select Xcode

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card