How to avoid restarting macOS after running `defaults write LaunchServices LSHandlers`?

I have changed default application opening specific file type using defaults write but for that to work I have to restart macOS. This feels unnecessary. Are there other options?

I've tried relaunching Finder, sudo pkill -1 Dock, and

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/\
lsregister -kill -r -domain local -domain system -domain user

without success.

Example command to change default app:

defaults write com.apple.LaunchServices/com.apple.LaunchServices.secure LSHandlers\
 -array-add '{LSHandlerContentType=public.shell-script;LSHandlerRoleAll=com.sublimetext.4;}'


Posted on Mar 23, 2024 10:52 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to avoid restarting macOS after running `defaults write LaunchServices LSHandlers`?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.