Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关闭macOS的Spotlight功能(节省CPU占用) #18

Open
sikma opened this issue Aug 15, 2024 · 0 comments
Open

关闭macOS的Spotlight功能(节省CPU占用) #18

sikma opened this issue Aug 15, 2024 · 0 comments
Labels
2024 2024年归档 MacOS Solution MacOS一些问题的解决方法

Comments

@sikma
Copy link
Owner

sikma commented Aug 15, 2024

背景:Mac上的 Spotlight 会调用mds、mdworker等进程,占用cpu使用率,造成系统卡顿。如果电脑配置比较低的话可以将Spotlight关闭,如果需要使用Spotlight 或者 Alfred等功能时,就需要将Spotlight 开启。

关闭Spotlight:
方法1: 使用 launchctl 管理 MacOS 服务。这里卸载Spotlight的配置. 卸载配置之后,就不会再启动mds等进程来扫描文件,这样后续新增App或者文件,在Spotlight和Alfred中也就搜索不到了。
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

方法2:
sudo mdutil -a -i off

重启Spotlight:

方法1:使用 launchctl 管理 MacOS 服务。这里加载Spotlight的配置,重启mds等进程扫描文件。
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

方法2:
sudo mdutil -a -i on

如果方法2中的命令后抛出 Spotlight server is disabled 这样的错误,那么就要用方法1中的操作了。

@sikma sikma added 2024 2024年归档 MacOS Solution MacOS一些问题的解决方法 labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 2024年归档 MacOS Solution MacOS一些问题的解决方法
Projects
None yet
Development

No branches or pull requests

1 participant