-
-
Save ulasozguler/d205281050babc2ccc0f6889d7f4db45 to your computer and use it in GitHub Desktop.
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS | |
sudo cp Spotlight Spotlight.bak | |
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight | |
cmp -l Spotlight Spotlight.bak | |
sudo codesign -f -s - Spotlight | |
sudo killall Spotlight |
@thanhbinh84, I had this, too; you need to remount /System
with write privileges: sudo mount -uw /
will remount everything as such. I'm pretty sure that SIP must be disabled in order to do this.
How do I undo the effects of this code?
@MrNotch9, in the folder /System/Library/CoreServices/Spotlight.app/Contents/MacOS
, the script copies Spotlight
to Spotlight.bak
, and then modifies Spotlight
. To reverse the changes, just rename Spotlight.bak
back to Spotlight
, and then restart Spotlight, e.g.:
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo mv Spotlight Spotlight.modified.bak
sudo mv Spotlight.bak Spotlight
sudo killall Spotlight
I need SIP disabled for this right?
@Mancerrss, yes, SIP must be disabled to modify the contents of /System
. Also, see here for an explanation of why sudo mount -uw /
is needed once booted on Catalina and later: https://apple.stackexchange.com/a/375611
does this disable Spotlight completely or just remove the icon from the menubar? I'd like only to remove the icon but continue using Spotlight as I only ever activate it via keyboard shortcut (Cmd+Space).
@dmattera, the latter; Spotlight remains functional.
works like a charm
if having issues on catalina:::
disable system integrity protection, then reboot
then unmount the drive
sudo mount -uw /
then run the above
@steveaolsen That was already mentioned in the comments before you 🙂
Catalina 10.15.7 work ok
Spotlight: Operation not permitted
10.15.5 (19F101)
Entered correct password.