Created
January 18, 2017 15:38
-
-
Save jnovack/39120926e657d8e54ff5874fdbfdeb16 to your computer and use it in GitHub Desktop.
Control Bluetooth Daemon through Command Line OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#read the current pref, returns '0' for off and '1' for on. | |
defaults read /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState | |
#set bluetooth pref to off | |
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 | |
#set bluetooth pref to on | |
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1 | |
#kill the bluetooth server process | |
sudo killall blued | |
#unload the daemon | |
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist | |
#reload the daemon | |
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist | |
#start the daemon | |
sudo launchctl start com.apple.blued |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it seems like it returns always 1 on monterey