Xcode using high CPU or making your Mac hot? How to calm it down

Updated · 2 min read · by

Quick answer

Xcode is busiest when it's indexing your project, building, running SwiftUI previews or keeping simulators open. Let indexing finish once, close simulators you aren't using, pause previews when you don't need them, and clear Derived Data if indexing never seems to finish.

What makes Xcode busy

How to make Xcode lighter

  1. Let indexing finish once. Leave the project open on power until Indexing disappears. Later edits only re-index what changed.
  2. Close simulators you aren't using. Quit the Simulator app, or shut down extra devices from its File menu.
  3. Pause previews. Hide the canvas (Editor › Canvas) when you're not working on UI, so it stops rebuilding as you type.
  4. Turn off live issues on a very large project if typing feels laggy: Xcode › Settings › General › Show live issues.
  5. Clear Derived Data if indexing or builds get stuck. Quit Xcode, find the Derived Data folder (its location is shown in Xcode › Settings › Locations), and delete the folder for your project. Xcode rebuilds it; the first build afterwards is slower.
  6. Exclude build folders from Spotlight and backups. Derived Data changes constantly. Adding it to Spotlight's privacy list and Time Machine's exclusions stops mds_stores and backupd chasing it.

Is it bad that Xcode uses 100% CPU while building?

No. A build is meant to use every core so it finishes as fast as possible. Fans spinning up during a big build is normal. The thing to watch for is high CPU when you aren't building, which usually means indexing or previews are stuck.

Questions people ask

Why is Xcode indexing forever?

Large projects, branch switches and package updates trigger re-indexing. If it never finishes, quit Xcode, delete the project's Derived Data folder and reopen it.

Is it safe to delete Derived Data?

Yes. It only holds build products and indexes, which Xcode recreates. The next build takes longer.

Why is my Mac hot when building in Xcode?

Compiling uses every core on purpose, which makes heat. It cools down once the build ends.

Do SwiftUI previews use a lot of CPU?

They can, because they rebuild your views as you type. Hide the canvas when you're not working on UI.