Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MacOs script to reset bluetooth, when devices cannot connect. Without rebooting. Depends on brew blueutil.
# first install blueutil using homebrew e.g.
# brew install blueutil
echo reset bluetooth script.
blueutil -p 0
echo turned off bluetooth.
# name of wi-fi device is en0 in my instance, you can change it as needed.
networksetup -setairportpower en0 off
sleep 3
echo turned off wi-fi.
networksetup -setairportpower en0 on
# sleep for 3 seconds otherwise bluetooth will start before
# wi-fi startup is complete.
sleep 3
echo turned on wi-fi.
blueutil -p 1
echo turned on bluetooth.
echo completed.
Copy link

crnastena commented Apr 18, 2019

To make file executable remember to do chmod +x Then you can run it ./

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment