Created
December 16, 2021 10:35
-
-
Save dive/7e646933bd97bb4feeae234a3c51ff8a to your computer and use it in GitHub Desktop.
Fix the iOS 15 Simulator high CPU usage due to the Spotlight/Suggestions Engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env sh | |
disable_suggestions() { | |
if [ -d "$1" ]; then | |
pushd "$1" || return | |
find . -name com.apple.suggestions.plist \ | |
-exec echo {} \; \ | |
-exec plutil -replace SuggestionsAppLibraryEnabled -bool NO {} \; | |
popd || return | |
fi | |
} | |
disable_suggestions "${HOME}/Library/Developer/Xcode/UserData/Previews/Simulator Devices/" | |
disable_suggestions "${HOME}/Library/Developer/CoreSimulator/Devices/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!
The script was failing for me with:
./fix_ios_simulator_spotlight_cpu.sh: bad interpreter: /bin/env: no such file or directory
I found out that the more common path to
env
is/usr/bin/env
. I changed to#!/usr/bin/env sh
and it's working for me.