Skip to content

Commit

Permalink
Fix installer failing in macOS 14.5.
Browse files Browse the repository at this point in the history
`launchctl kickstart -k` is no longer permitted for `coreaudiod`. See
<https://developer.apple.com/documentation/macos-release-notes/macos-14_4-release-notes>.
(Thanks to @gchilds.)

As explained in those release notes, `kill` still works. `postinstall`
was using `killall coreaudiod` if `launchctl kickstart -k` failed, but
that was failing as well because it had to be `sudo killall coreaudiod`.

I haven't been able to reproduce this on macOS 14.4, only 14.5. Not sure
why.

See #705.
  • Loading branch information
kyleneideck committed Apr 23, 2024
1 parent 73f221e commit 3097f4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions MANUAL-INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
(Audio will stop working until the next step, so you might want to pause any running audio apps.)

```shell
sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod
sudo killall coreaudiod
```

or, if that fails

```shell
sudo killall coreaudiod
sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod
```
- Run `Background Music.app`.

Expand Down
4 changes: 2 additions & 2 deletions MANUAL-UNINSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<sup>(Open `/Applications/Utilities/Terminal.app` and paste the following at the prompt.)</sup>

```shell
sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod
sudo killall coreaudiod
```
or, if that fails

```shell
sudo killall coreaudiod
sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod
```
- Go to the Sound section in System Settings and change your default output device at least once. (If you only have
one device now, either use `Audio MIDI Setup.app` to create a temporary aggregate device, restart any audio apps that
Expand Down
17 changes: 9 additions & 8 deletions pkg/postinstall
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
# postinstall
#
# Copyright © 2017-2022 Kyle Neideck
# Copyright © 2017-2022, 2024 Kyle Neideck
#

# Make sure we use the built-in versions of programs, for consistency. Probably not necessary
Expand Down Expand Up @@ -53,13 +53,14 @@ bash "post_install.sh" "$xpc_helper_install_path" "BGMXPCHelper.xpc/Contents/Mac
# some of these commands don't work with older versions of launchctl, so I figure there's no
# harm in trying a bunch of different ways (which should all work).
(sudo launchctl kickstart -k system/com.apple.audio.coreaudiod &>/dev/null || \
launchctl kill SIGTERM system/com.apple.audio.coreaudiod &>/dev/null || \
launchctl kill TERM system/com.apple.audio.coreaudiod &>/dev/null || \
launchctl kill 15 system/com.apple.audio.coreaudiod &>/dev/null || \
launchctl kill -15 system/com.apple.audio.coreaudiod &>/dev/null || \
(launchctl unload "$coreaudiod_plist" &>/dev/null && \
launchctl load "$coreaudiod_plist" &>/dev/null) || \
killall coreaudiod &>/dev/null) && \
sudo launchctl kill SIGTERM system/com.apple.audio.coreaudiod &>/dev/null || \
sudo launchctl kill TERM system/com.apple.audio.coreaudiod &>/dev/null || \
sudo launchctl kill 15 system/com.apple.audio.coreaudiod &>/dev/null || \
sudo launchctl kill -15 system/com.apple.audio.coreaudiod &>/dev/null || \
sudo killall coreaudiod &>/dev/null || \
(sudo launchctl unload "$coreaudiod_plist" &>/dev/null && \
sudo launchctl load "$coreaudiod_plist" &>/dev/null)
) && \
sleep 2

# Wait until coreaudiod has restarted and BGMDevice is ready to use.
Expand Down

0 comments on commit 3097f4b

Please sign in to comment.