0

I'm trying to find out how to turn Bluetooth On or Off by using the Terminal on macOS Catalina.

I used to be able to do it with the following commands:

alias bton="sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 1"
alias btoff="sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && \sudo killall -HUP blued"

Unfortunately these no longer work.

1

Blueutil, a command-line utility for macOS that lets us turn Bluetooth on and off with one command!

Start by installing blueutil with HomeBrew:

brew install blueutil

The -p flag is a switch for turning Bluetooth on and off:

Turn bluetooth off

blueutil -p 0

Turn bluetooth on

blueutil -p 1
|improve this answer|||||
  • 1
    This is also the accepted answer on the potential duplicate. – ankii Jan 8 at 15:40
  • is there no method of doing this without having to install a 3rd party app? – esaruoho Jan 9 at 15:29

Not the answer you're looking for? Browse other questions tagged .