Do not open Apple Music when pressing a media key

How do I prevent Apple Music from opening when pressing a media key?

If I have Sonos or Spotify opened, the media keys control them as they should. If they are closed, annoyingly, Apple Music opens, prompts login etc. How do I make it disappear from my life completely?


Solution 1:

This still works under Big Sur on M1 Macs:

launchctl bootout "gui/$(id -u "${USER}")/com.apple.rcd"
launchctl disable "gui/$(id -u "${USER}")/com.apple.rcd"

The top command disables it immediately. The bottom command prevents it from reactivating on restart.

To return to the default behaviour, replace bootout with bootstrap and disable with enable:

launchctl bootstrap "gui/$(id -u "${USER}")/com.apple.rcd"
launchctl enable "gui/$(id -u "${USER}")/com.apple.rcd"

Note this may disable the media keys for other apps as well.

Solution 2:

There are a few ways that you do to achieve your requirements.

But you have to disable Apple’s SIP which I don't recommend personally.

So, I would suggest you use this third-party application named as Mac Media Key Forwarder. Use the latest version 3.0 for Catalina.

You can prioritize which app you would like to control or you can go with the default behaviour which controls the running app. The app runs in the menu bar.

Download the app and move it to your Applications folder. Double-click to start it and you will see a black dot appear in your taskbar. Click on the dot and make sure that the option to start on session initialization is ticked. Then change the option to give priority to Spotify over Apple Music for your media keys.