What makes Xcode busy
- Indexing. After opening a project or switching branches, Xcode indexes your code for autocomplete and navigation. Xcode's activity area at the top of the window shows Indexing while it runs.
- Building. Compiling uses every core on purpose. In Activity Monitor you'll see processes like
swift-frontendandclangduring a build. - SwiftUI previews. The canvas builds and runs your views in the background, and keeps rebuilding as you type.
- Simulators. Each running simulator is a small virtual device using CPU and memory, even when you're not looking at it.
- Live issues. Xcode checks your code as you type to show errors early.
How to make Xcode lighter
- Let indexing finish once. Leave the project open on power until Indexing disappears. Later edits only re-index what changed.
- Close simulators you aren't using. Quit the Simulator app, or shut down extra devices from its File menu.
- Pause previews. Hide the canvas (Editor › Canvas) when you're not working on UI, so it stops rebuilding as you type.
- Turn off live issues on a very large project if typing feels laggy: Xcode › Settings › General › Show live issues.
- 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.
- 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_storesandbackupdchasing 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.