阻止 Apple Music 应用自动启动
Stop the Apple Music app from launching

原始链接: https://lowtechguys.com/musicdecoy/

**Music Decoy** 可以防止系统“音乐”应用在按下播放键、使用蓝牙耳机或结束通话时自动启动。macOS 的 `rcd` 守护进程会在没有其他媒体活动时,一旦收到播放指令便会触发“音乐”应用;而 Music Decoy 会拦截这一进程。 **自定义:** 自 v1.1 版本起,你可以配置该应用以启动指定的播放器(如 Spotify)来替代“音乐”。请在终端(Terminal)中运行以下命令: `defaults write com.lowtechguys.MusicDecoy mediaAppPath /Applications/Spotify.app` 如需重置,请使用: `defaults delete com.lowtechguys.MusicDecoy mediaAppPath` **应用管理:** 由于 Music Decoy 在后台运行且没有 Dock 图标或菜单栏图标,你必须通过“活动监视器”或在终端中运行 `killall 'Music Decoy'` 来关闭它。 **为什么选择它?** 与禁用 `rcd` 守护进程(会导致媒体快捷键完全失效)或使用 *noTunes* 等工具(在“音乐”应用启动后将其杀掉)不同,Music Decoy 会主动将播放指令引导至你偏好的应用程序,从而提供更流畅、更节省资源的使用体验。

Hacker News 最新 | 往日 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 停止 Apple Music 应用自动启动 (lowtechguys.com) 13 分 | bobbiechen | 29 分钟前 | 隐藏 | 往日 | 收藏 | 讨论 | 帮助 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Configuration

Since v1.1 you can configure Music Decoy to launch another app when the ▷ Play button is pressed.

To do that, run the following command in the Terminal (example for Spotify):

defaults write com.lowtechguys.MusicDecoy mediaAppPath /Applications/Spotify.app

To reset the configuration, run:

defaults delete com.lowtechguys.MusicDecoy mediaAppPath

When does Music launch itself?

  • When you press the ▶ Play key on your keyboard and there is no other app playing audio
  • When a bluetooth headset connects and sends a play command
  • When ending a call, which causes the bluetooth headset to switch from call mode to music mode

Why does this happen?

There is a daemon called rcd (short for Remote Control Daemon) that is responsible for handling media keys.

When a play event occurs, rcd checks if there is an app that is currently playing audio. If there is, it sends the play command to that app. If there isn't, it launches the system Music app.

There is a way to disable that daemon but it also disables the ability to control media playback with the keyboard.

Alternatives

Based on this StackExchange answer, there are a few different ways to achieve the same effect:

launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist

Problem: disables the Play button completely

noTunes which listens for launched apps and kills Music as soon as it is launched

Problem: it does use a tiny bit of CPU in the background although checking for launched apps is very little work

Advantage: it can launch a custom app on Play which this app can't do

Uh.. how do I quit this app?

The app has no Dock icon and no menubar icon so to quit it you'd need to do one of the following:

  • Launch Activity Monitor, find Music Decoy and press the ❌ button at the top
  • Run the following command in the Terminal: killall 'Music Decoy'
联系我们 contact @ memedata.com