Skip to main content
Solved

Enabling Bluetooth via Terminal

  • April 4, 2025
  • 7 replies
  • 115 views

Forum|alt.badge.img+4

Good morning,

We recently upgraded our MacBook fleet to MacBook M1 Apple Silicon. Our old scripts that allowed us to force bluetooth back on does not work anymore do the restrictions of Apple Silicon. I was checking if any found a to turn bluetooth on using terminal? I found the  /usr/sbin/bluetoolctl in terminal but it only shows if the power is on for bluetooth but nothing else.

Best answer by _Daley

You could consider using blueutil to do this: 

https://github.com/toy/blueutil

 

7 replies

snowfox
Forum|alt.badge.img+9
  • Contributor
  • April 4, 2025

This is related and may be of use to you.  I force Bluetooth off in our student labs via Configuration Profile.

Preference Domain:    com.apple.MCXBluetooth

Custom Applications & Settings:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>DisableBluetooth</key> <true/> </dict> </plist>

Try setting the true to false.  This might force it on.  Not sure, haven't tried it as we only force it off in student labs.


mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • April 4, 2025

This is the script from CIS to disable:

• 2.3.3.11 Ensure Bluetooth Sharing Is Disabled (Automated)

 

Edit: My bad - this is for Bluetooth Sharing. 
% /usr/bin/sudo -u <username> /usr/bin/defaults -currentHost write
com.apple.Bluetooth PrefKeyServicesEnabled -bool false
% /usr/bin/sudo -u firstuser /usr/bin/defaults -currentHost write
com.apple.Bluetooth PrefKeyServicesEnabled -bool false

 

You could massage the script, and flip "false" to "true."


PaulHazelden
Forum|alt.badge.img+12
  • Jamf Heroes
  • April 4, 2025

I am using a script, to turn it off or on, and so far it works on Sequoia for me.

# Turn on Bluetooth service /usr/bin/defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1

Use a 0 to turn it off.
One day I may go fully down the configuration profiles route, but not yet.
As with all scripts you get from the internet, Test, Test, and Test again before sending it to production.


_Daley
Forum|alt.badge.img+6
  • Contributor
  • Answer
  • April 4, 2025

You could consider using blueutil to do this: 

https://github.com/toy/blueutil

 


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

This is related and may be of use to you.  I force Bluetooth off in our student labs via Configuration Profile.

Preference Domain:    com.apple.MCXBluetooth

Custom Applications & Settings:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>DisableBluetooth</key> <true/> </dict> </plist>

Try setting the true to false.  This might force it on.  Not sure, haven't tried it as we only force it off in student labs.


I just tried your profile config. It works, but if enduser decides to turn off BT again after it was force back on it will remain off.


pete_c
Forum|alt.badge.img+16
  • Honored Contributor
  • April 4, 2025

I am using a script, to turn it off or on, and so far it works on Sequoia for me.

# Turn on Bluetooth service /usr/bin/defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1

Use a 0 to turn it off.
One day I may go fully down the configuration profiles route, but not yet.
As with all scripts you get from the internet, Test, Test, and Test again before sending it to production.


You've got a capital B in Bluetooth.  On two 15.4 Macs, I see it as lowercase.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 7, 2025

You could consider using blueutil to do this: 

https://github.com/toy/blueutil

 


I tested blueutil and it works.