答案1
这篇文章给出了答案:
https://www.jamf.com/jamf-nation/discussions/12545/a-script-to-disable-handoff
禁用切换.sh:
#!/bin/bash
#LocalHomes=$(/usr/bin/dscl . -list /Users NFSHomeDirectory | grep -v /var/ | grep -v /Library/ | awk '$2 ~ /^\// {print $2;}')
LocalHomes=$(ls -l /dev/console | awk '{ print $3 }')
for OneHome in $LocalHomes; do
userName=$(/bin/echo $OneHome | awk -F "/" '{print $NF;}')
sudo -u $userName defaults write $OneHome/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist ActivityAdvertisingAllowed -bool no
sudo -u $userName defaults write $OneHome/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist ActivityReceivingAllowed -bool no
done