Stop Apple Music from Hijacking Your Media Keys
If you use Spotify, YouTube Music, or any other media player on macOS, you’ve likely encountered this frustration: you press the Play/Pause key on your keyboard, expecting it to control your current music, but instead, Apple Music launches and takes over.
This behavior is driven by a system daemon that listens for media key events. In this post, we’ll look at how to disable this behavior permanently using a simple terminal command.
The Solution
To stop this behavior, we need to unload and disable the rcd service.
Open your terminal and run the following command:
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
That’s it! You should now be able to use your media keys with your preferred player without Apple Music interfering.
Explanation
Let’s break down what this command does:
launchctl: This is the command-line interface for interacting withlaunchd, the macOS service management framework (similar tosystemdon Linux).unload: Tellslaunchdto stop the specified service and remove it from the list of loaded jobs.-w: This flag writes the change to the configuration override database, ensuring the service remains disabled even after you reboot your machine./System/Library/LaunchAgents/com.apple.rcd.plist: This is the path to the property list file that defines the Remote Control Daemon service.
How to Revert
If you ever decide you want the original behavior back - perhaps you’ve switched to Apple Music - you can re-enable the service by running:
launchctl load -w /System/Library/LaunchAgents/com.apple.rcd.plist
Background
macOS has a background process called the Remote Control Daemon (rcd).
Its job is to listen for media key presses (Play, Pause, Next, Previous) and direct them to the appropriate application.
By default, it aggressively favors Apple Music (or iTunes in older versions), often launching the app even if you were just listening to something else.
Conclusion
This simple one-liner can significantly improve your experience if you live outside the Apple Music ecosystem. It allows your active media player to handle the keys directly without the OS overriding your intent.
Happy coding (and listening)!
:ZZ