I use Spotify all the time and find it highly annoying when the play button on my keyboard opens iTunes instead of controlling Spotify. This happens with other media buttons too once iTunes is open.
I don’t use iTunes at all so I found a solution to prevent this nonsense from happening. Follow the steps below if you want to do the same.
The first step is to diable Apple’s SIP. Once you apply the command to disable execution of iTunes you should perform the steps again to re-enable SIP.
- From the Apple menu, choose βRestartβ¦β > βRestartβ.
- Simultaneously press and hold the βCommandβ and βRβ buttons. This will start you in Recovery Mode.
- Select βUtilitiesβ > βTerminalβ.
- Type one of the following, then press βEnterβ:
- Disable System Integrity Protection:Β
csrutil disable
- Enable System Integrity Protection:Β
csrutil enable
- Disable System Integrity Protection:Β
Then restart and let the login proceed as normal. Once you’re in, run the following command:
sudo chmod -x /Applications/iTunes.app/Contents/MacOS/iTunes
This will prevent iTunes from opening, so make sure that is what you really want. If you still want to use iTunes for any purpose (for example iPhone and iPad backups) this method above won’t work for you, as it will prevent the backups from taking place.
If you want to go back to default behavior, you can enter Terminal once again (make sure you disable SIP again before) and type in the following:
sudo chmod +x /Applications/iTunes.app/Contents/MacOS/iTunes
Alternative: Using an Application
Applications such as “Karabiner-Elements” or “BetterTouchTool” can be used to remap your keyboard keys or disable specific key functions.
That’s it! Enjoy your newly found freedom from iTunes.
Problem solved. Turns out chmod changes permissions and my stupid me typed sudo chmod -x /applications … Without The rest because music.app didnt work in the place of itunes.app. Well ….. And while redoing with chmod +x i forgot to see the space bar between chmod +x and the word Applications. Greetings
Warning/Help: I cant use any programs on my mac os montery anymore. The application folder is not accessible from my admin account.
https://i.ibb.co/wwTwc5S/20220417-215757.jpg
I replaced “itunes” with music.app by pulling the music app in the terminal… Total noob in using the terminal but this i knew
Now my applications all have questionmarks and my computer is not usable anymore π
In the picture you see me trying to undo what i have done. The terminal spilled out about the same answer like he did when i did the big mistake. So i uploaded a screencapture. But it didnt work.
Hi there,
I’m on Catalina and this Terminal operation worked for me :
Once youβve got the Terminal open, run this command:
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
Hereβs a quick breakdown of what this all means, so it feels a little bit less like a magic spell:
launchctl is a simple application on your Mac for controlling agents that run in the background.
The word unload tells launchctl you want to disable a particular agent.
/System/Library/LaunchAgents/com.apple.rcd.plist is the location of the agent you are disabling. Agents run in the background; this one launches iTunes when the βPlayβ key is pressed.
Once youβve run the command, try pressing Play on your keyboard. Nothing happens!
Source : https://www.howtogeek.com/274345/stop-itunes-from-launching-when-you-press-play-on-your-macs-keyboard/
yeah I pressed Cmd R when restarted but am presented with Restore MacOS, Use Disc Utility etc no Terminal access.
And going back what others have said about totally diabling iTunes, I feel I should leave this alone.
I use VOX as my main music player and it has it’s own extension keys, which is supposed to take over the media keys, but doesn’t, they still control iTunes, so thought this method may help but looks like that’s a no.
I’m going to have to argue that this method is a *very* bad idea. Disabling System Integrity Protection can be a Very Bad Thingβ’. A better option would be to grant accessibility access to the app you’d rather control in question:
1) Open Sytem Preferences
2) Select Security and Privacy
3) Click the Privacy tab
4) Choose “Accessibility”
5) Tic the box for the application you want to control with the media keys, then restart said app.
The above was found in this reddit comment: https://www.reddit.com/r/MacOS/comments/8r4vve/macos_mojave_media_keys/e7lvt84/
Au contraire, disabling it means freeing yourself from the Apple thought police, and lets you install (or diable) any software you want, not just that of which Apple approves.
How are you guys getting into Terminal? I just see Disk Utility which has First Aid, Partition. Erase Restore etc
thanks!!! makes me sad that this is even a thing. but i really appreciate the csrutil disable hint.
So…. I tried this as well, and my media keys have STOPPED working altogether as well! Even when Spotify is the active application pause/play and prev/next don’t work. I tried both with and without the MediaKey Forwarder…. no luck.
@Jean Galea: you suggest using the same Terminal command to enable iTunes again? how is that possible? I can’t get it to work. Please reply, the situation is worse after your suggestion π
I’m not sure what to suggest as I’m on the latest MacOS and things still work fine for me, perhaps because I applied this before doing the latest updated? It doesn’t make much sense to me that that would affect things though.
If anyone knows the latest way to achieve this let me know and I’ll update the post.
I’m citing what “m” replied to me:
“to restore iTunes, the other command should be βchmod +xβ.”
It did the trick for me, iTunes is back again and the buttons works like normal again.
to restore iTunes, the other command should be “chmod +x”.
Thx a lot!!! That did the trick.
I tried this and realised that I wasn’t able to open iTunes at all afterwards. That’s NOT what I wanted. Then I tried to go back to default behavior following your steps but IT DOESN’T WORK.
Please tell me and others how to be able to open iTunes again!
(All I wanted was iTunes NOT to open when pressing the play/F8 button but this tip totally disables the ability to open iTunes!)
You have to use +x instead of -x. The second command is wrong.
Fixed.
Since I upgraded to Mojave this morning the hotkeys were mapped to open iTunes again. Previous MacOS worked perfectly with Google Music in my Chrome browser.
Followed your first tip disabling Apple’s SIP and running the terminal command. No luck! And I’m not able to re-enable the default behaviour. Even after enabling and disabling the SIP again.
So.. mediakeys don’t do anything anymore.
I would suggest people not to follow this tip.
Strange, it still works for me.
HSMKE only allows you to CHOOSE between Spotify and iTunes. I want to use my media keys with a 3rd party app and not have iTunes open every time I press play. noTunes prevents iTunes from launching, while enabled. Works perfectly for me.
https://github.com/tombonez/noTunes
Thanks for the suggestion, will check it out.