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?

@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.

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.

Same here, on M1 MBA. Xcode 13.1.

Xcode 13 simulator high CPU Spotlight
 
 
Q