Xcode 13 simulator high CPU Spotlight

I'm on a MacBook Air M1 with Monterey and XCode 13 beta. On the first night my MBA ran out of battery within three hours. I check cpu usage, and it was Spotlight. Left it running for hours and hours, but Spotlight did not complete it's tasks. Then I noticed in an Activity Monitor sample output that it seemed to have a relation to the Xcode simulator. I quit that, and the cpu utilisation went down.

I can reproduce it. Nothing special, an empty iOS App in an iPhone 12 Pro or mini simulator will cause busy cpu cores with Spotlight.

I recommend not leaving the simulator running when on battery if you have the same issue 😉

Anyone else seeing Spotlight taking up a lot of CPU resources when the Xcode simulator is running?

Post not yet marked as solved Up vote post of Hanss Down vote post of Hanss
14k views
  • My Intel MBA seems to show the same symptoms. The symptoms may start a couple of minutes after the simulator is started

  • Same here. Had to kill the spotlight process

  • Same here, but on a Mac with Intel CPU

Replies

I pretty much had the same issue. It seems that Xcode 13's simulators do tend to take up a good amount of CPU usage, and my MacBook Air M1 gets really warm while working on Xcode 13. I had the Spotlight issue while I was running my Xcode 13 on an external SSD, but once I transferred it to my internal, that issue did fade away.

I hope Xcode 13's next beta would improve its performance.

My workaround for now, to avoid draining the battery like crazy, is to just kill this spotlight process on Activity Monitor.

Yes, I'm seeing this issue too. I thought it was a macOS Monterey beta 3 issue, but now I'm seeing Spotlight at high CPU when running the simulator in Xcode 13 on Big Sur 11.4.

Confirmed here, I'm seeing exactly the same thing. M1 MBP, Xcode 13b3 on Big Sur.

  • Same but on M1 air. Just updated to XCode 13 through the App Store a few days ago. Workaround is killing the Spotlight process but it just comes back.

  • Same here on my MBA M1 (XCode 13). Spotlight process takes "109" CPU% and cause the laptop real hot, had to force quit "Spotlight" in activity monitor for it.

Add a Comment

Still seeing it on M1 Air, Xcode 13b5, Monterey 12b6.

Xcode just sitting there -- not running any apps -- is consuming about 240% CPU, Spotlight about 110% CPU.

Running then stopping an app launches a second Spotlight process, with similar CPU.

Quitting Xcode but leaving the simulator on the home screen -- not running an app -- leaves a Spotlight process consuming ~170% CPU.

Nuts.

(Quitting the simulator as well brings Spotlight back to 0.0% and drops the cpu back to negligible levels.)

XCode 13 running on an iMac Pro with Intel Xeon CPU has the same issue. High Spotlight CPU usage and also multiple diagnosticd processes with high CPU also.

I can confirm that I'm still experiencing high CPU usage coming from the Spotlight process launched by the simulator. I'm on M1, Xcode 13 App Store release (13A233), macOS 11.6

i'm on macos 12 beta 7 and xcode 13 from store and have same problem Xcode 13 simulator high CPU Spotlight

Hi all,

Seems like I was able to resolve the issue by switching off Siri & Search in Simulator Settings. Also I went through all of the installed apps and disabled everything there as well.

  • This fixed it for me. Thanks a bunch.

  • Thanks @ruslan that really did the trick.

  • Fixed it for me as well. Thx a bunch!

@ruslan.alikhamov

THANK YOU SOOO MUCH!!!

This did the trick!

My system is affected since update to Xcode 13, Spotlight is running and SourceKitService, too - but now it seems it is over :)

I found a solution in this article very helpful. There are a couple of commands one can execute to fix the problem for both SwiftUI preview and regular simulators.

I found that the problem seems to arise when I use the iPhone 13 simulator. I cannot confirm if this is the cause, though.

Thumbs up to this solution! Attached is an image of cpu charts from a M1 Mabcbook pro running on macOS Monterey. Clear improvement seen after making this change and restarting the simulator.

  • The problem will persists though when Swift Playgrounds is open.

Add a Comment

open Activity Monitor and find the name of your app that never dies open terminal

ps -ef | grep YourAppName

you'll should see 2 lines starting with 3 numbers

kill -9 ThirdNumberOfLine1FromWhatWasFoundAbove

Has anyone filed a bug about this? If so, please post your bug number.