You have not agreed to the Xcode license agreements macOS Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

macOS: Agreeing to the Xcode/iOS license requires admin privileges, please run "sudo xcodebuild -license" and then retry this command

A new Xcode (or CLT) version needs its license accepted before command-line tools run.

Exact message you may see You have not agreed to the Xcode license agreementsAgreeing to the Xcode/iOS license requires admin privileges, please run sudo xcodebuild -licenseYou have not agreed to the Xcode license agreements. You must agree to the license below in order to use Xcodexcodebuild: error: The license agreement has not been accepted
Seen on: macOS

Meaning

Run sudo xcodebuild -license and agree (press space to scroll, type agree), or accept non-interactively with sudo xcodebuild -license accept. Needed after every Xcode update, including on CI machines.

Common causes

  • Xcode freshly installed or updated
  • CLT updated via Software Update
  • Fresh CI runner
  • License accepted for another user/path
  • Switched Xcode versions with xcode-select

⚡ Quick fix

  1. sudo xcodebuild -license accept
  2. Interactive: sudo xcodebuild -license
  3. Verify: xcodebuild -version

Detailed fix by platform

macOS

  1. sudo xcodebuild -license accept && xcodebuild -version

How to diagnose

  1. Version — New Xcode?
  2. Privileges — sudo?
  3. CI — Automated accept?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Can't install the software because it is not currently available from the Software Update server — macOS: xcode-select: error: Can't install the software because it is not currently available from the Software Update server (macOS)Can't install the sof…Cannot preview in this file — SwiftUI Preview: Cannot preview in this file — the preview crashed / failed to build (iOS)Cannot preview in thi…Command CodeSign failed — Command CodeSign failed with a nonzero exit code (errSecInternalComponent / resource fork, Finder information not allowed) (iOS)Command CodeSign fail…Failed to prepare device for development — Xcode: Failed to prepare device for development / iPhone is not available. Please reconnect the device (iOS)Failed to prepare dev…Homebrew Cask: It seems there is already an App at — Homebrew: Error: It seems there is already an App at '/Applications/Chrome.app' (macOS)Homebrew Cask: It see…invalid active developer path — xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun (iOS)invalid active develo…ITMS-90725 — ITMS-90725: SDK version issue — This app was built with the iOS 17.x SDK. All iOS apps submitted to the App Store must be built with the iOS 18 SDK or later (iOS)ITMS-90725No such module — Swift: No such module 'X' (module not found) (iOS)No such moduleYou have …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.