Skip to main content
Solved

Enable AirPlay Receiver

  • June 6, 2025
  • 2 replies
  • 144 views

Forum|alt.badge.img+4

There's plenty of posts regarding disabling AirPlay Receiver, but we actually want to ENABLE it. Our previous AirPlay solution, AirServer, is not being properly maintained by the dev, doesn't play nice on our network, and we have just about given up on it.

I tried reversing @ljcacioppo 's solution for disabling the setting here, but when set to true, it doesn't toggle the setting on; it only allows the user to enable it. This is on Seqouia 15.5. Ideally, we would like the following things set via profile:

  • AirPlay Receiver set to ON
  • Allow AirPlay for Anyone on the Same Network
  • Require password set to OFF (the user must click a popup to allow the connection so this is fine)

Does anyone have a working solution for this?

Best answer by dmccluskey

this script should do it.

 

 

#!/bin/bash

loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
#hostId=$(system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -d ":" -f2 | xargs)
sudo -u "$loggedInUser" defaults write "/Users/$loggedInUser/Library/Preferences/ByHost/com.apple.controlcenter.plist" AirplayReceiverAdvertising -int 3

2 replies

dmccluskey
Forum|alt.badge.img+8
  • Valued Contributor
  • Answer
  • June 9, 2025

this script should do it.

 

 

#!/bin/bash

loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
#hostId=$(system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -d ":" -f2 | xargs)
sudo -u "$loggedInUser" defaults write "/Users/$loggedInUser/Library/Preferences/ByHost/com.apple.controlcenter.plist" AirplayReceiverAdvertising -int 3


Forum|alt.badge.img+4
  • Author
  • Contributor
  • June 20, 2025

this script should do it.

 

 

#!/bin/bash

loggedInUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
#hostId=$(system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -d ":" -f2 | xargs)
sudo -u "$loggedInUser" defaults write "/Users/$loggedInUser/Library/Preferences/ByHost/com.apple.controlcenter.plist" AirplayReceiverAdvertising -int 3


Yes! Thank you, this is exactly what we were looking for. FYI, for anyone using this, these are the corresponding settings for the AirplayReceiverAdvertising key, which affects the "Allow AirPlay for" setting:

  1. Current User
  2. Anyone on the Same Network
  3. Everyone