78

I accidentally disabled the Bluetooth on Mac OS. I can't enable it because my Bluetooth based keyboard and mouse are now disabled.

I found a USB based keyboard I can use, so how can I enable Bluetooth just using my keyboard?

Is there a command line way or shortcut I can use?

16 Answers16

121

Here's a sequence that worked for me (OS X 10.6.7) when I had the same issue.

  1. Press Space to activate Spotlight.

  2. Type "bluetooth", choose the 'Bluetooth File Exchange' application, and press Return.

  3. Bluetooth File Exchange will prompt to enable the bluetooth hardware, press Return.

  4. Bluetooth is now enabled and you can quit Bluetooth File Exchange.

Gareth
  • 19,080
netnichols
  • 1,311
40

I've been using blueutil occasionally - seems to work. It's free and comes with the source code.

blueutil --power 1
blueutil --power 0

Older versions:

Usage:

Print bluetooth status
blueutil status

Switch bluetooth on
blueutil on

Switch bluetooth off
blueutil off

24
  1. +Tab until you get to the Finder.
  2. ++G to bring up the Go To dialog: type in /Applications.
  3. Just type the letters "sys" and your highlight should be over "System Preferences". Press +O to open it.
  4. In System Preferences, the cursor should be in the search field. Just type in "bluetooth" and press Return. Now you're in the Bluetooth preferences.
  5. Press Tab, and there should be a faint highlight on the "On" checkbox.
  6. Press Space, and that should turn it on.

If you happen to have Quicksilver installed, invoke System Preferences from there and go directly to step 4 above. Or without Quicksilver press +Space to activate Spotlight, type "bluetooth" and go directly to the Bluetooth preference pane, and step 5 above.

If you don't have a Command key on the keyboard, then hit Ctrl+F2 to activate the Apple menu, press and go to System Preferences and continue at step 4 above.

If in Step 5 pressing Tab does not navigate through all inputs, then press Ctrl+F7 to activate Full Keyboard Access. When done, press Ctrl+F7 again to disable it.

Indrek
  • 24,874
fideli
  • 14,884
11

I wanted to mention a little known feature of the OS:

If you reboot and unplug the keyboard, the OS will automatically enable Bluetooth and start looking for BT keyboards and mice. From Apple's official documentation:

  1. Turn on your Mac.
  2. If no USB mouse is detected, the Mac will power up to the Bluetooth trackpad or mouse setup assistant. The screen should alternate between an image of the trackpad and one of the mouse, as below.

However, this is apparently controlled by a Bluetooth setting which might be disabled:

Bluetooth Setup Assistant Settings

If this setting has been disabled by the user (it is enabled by default) then this method will not work.If these options have been disabled, you can re-enable them using the terminal commands:

sudo defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekKeyboard '1'
sudo defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekPointingDevice '1'

(However you might need to SSH in to do that, a which point one of the other answers might be better)

Josh
  • 9,947
6

control+F8 activates the status menu.(upper right corner) If bluetooth button is enabled in the status menu, you can select the bluetooth-menu-option using the   ↑    ←  ↓   →   and  return   to activate bluetooth

Depending on your keyboard preference settings, you may need to press ctrl+fn+F8.

JayRizzo
  • 262
Pixxit
  • 91
5

Here is a faster way which I just did on Lion:

  1. Command + Spacebar to start spotlight
  2. type "bluetooth"
  3. Select "Bluetooth File Exchange"
  4. This will trigger a warning that bluetooth is disabled, the enable button should be highlighted so all you need to do now is press return
aprato
  • 151
4

This method required the bluetooth menu bar status icon to show and used AppleScript GUI scripting (requires System Preferences » Universal Access » Support for assistive devices IIRC):

tell application "System Events"
    tell process "SystemUIServer"
        tell (menu bar item 1 of menu bar 1 whose description is "bluetooth")
            click
            click menu 1's second menu item
        end tell
    end tell
end tell

Call from command line using osascript:

osascript -e 'tell application "System Events" to tell process "SystemUIServer" to tell (menu bar item 1 of menu bar 1 whose description is "bluetooth") to {click, click (menu item 2 of menu 1)}'

Do not edit this post. I don't care if you don't like the scroll bar. It's easier to select by triple-clicking this way.


Alternatively, you can launch System Preferences and click the checkbox:

tell application "System Preferences"
    set current pane to pane id "com.apple.preferences.bluetooth"
    tell application "System Events"
        tell process "System Preferences"
            click checkbox "On" of window "Bluetooth"
        end tell
    end tell
    quit
end tell

While a GUI process launches, it isn't visible except for the Dock icon.

Daniel Beck
  • 111,893
3
  • Press Space, write "bluetooth".
  • Press the following combination: FnF7. A light blue frame appears arround the activate box.
  • Press spacebar, finished!
slhck
  • 235,242
3

Use Alfred and the Bluetooth workflow

Alfred
http://www.alfredapp.com

Bluetooth Toggle

http://www.alfredforum.com/topic/1047-bluetooth-toggle/?hl=bluetooth

enter image description here

spuder
  • 10,135
2

I use ^ B (Command + Ctrl + B) for this.

First install brewutil,

  1. brew update
  2. brew install blueutil

Second setup shoutcut,

  1. Start Automator.

  2. Open File -> New

  3. Select Service document type. (on MacOS Sonoma it's "Quick Action" instead)

  4. Now select, Service receives no input in any application

  5. Now Add action - Run Shell Script

  6. And now enter the following script and click save

     export PATH=/usr/local/bin:$PATH
     bluetoothStatus=$(blueutil -p)
     [[ $bluetoothStatus -eq 0 ]] && blueutil -p 1 || blueutil -p 0
    
  7. Now go to System Preferences -> KeyBoard -> Shortcuts -> Services.

  8. Go to General section.

  9. The service created via automator will be listed there and a shortcut can be set.

The export line should be there even it is included in the ./bash-* files.

JRRT
  • 3
2

In my case, the CTRL+F8 method (posted by PIXIT, down below) is exactly what I need. Here's why: When I change the battery on my Magic Mouse, the computer often fails to reconnect the mouse. The other answers here talk about turning Bluetooth on or off. My Bluetooth is on, but I need to specifically activate the Mouse connection. Going through the status bar with the arrows lets me go down through the menu to My Mouse, and sideways to Connect.

(OS 10.10.3)

1

If you are using Sierra OS then you can voice activate it through Siri "Turn on bluetooth", or off for that matter. You had the option to set the keyboard shortcut when you installed Sierra. Otherwise control and space is the default/or via Spotlight.

1

An updated version of the blueutil can be done using homebrew.

In a terminal:

  1. Assure you have homebrew installed:

    $ brew -v
    

    if command not found: then install it:

    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  2. update the packages

    $ brew doctor 
    
  3. install the package blueutil

    $ brew install blueutil
    
  4. check the bluetooth status (0 means off, 1 means turned on):

    $ blueutil -p
    
  5. set the state:

    $ blueutil -p on        # turns on the Bluetooth
    $ blueutil -p off       # turns off the Bluetooth
    
1

Simply turn on your Mac. press F then type "bluetooth" then press until you reach the "bluetooth" icon.

Then O and to enable Bluetooth! That's the easiest way to make it!

slhck
  • 235,242
Elina
  • 11
1

If you are using a apply keyboard (wired) - just press Option+F8. If you are using a Windows keyboard (wired) - just press Ctrl+F8.

kenorb
  • 26,615
0

If you are attempting to reinstall OSX from boot media, and your Bluetooth wasn't enabled at the start (still an issue with Mountain Lion Recovery media), Ctrl + fn + F2 gets you to the menus at the top (as described many other places), which contain other useful utilities, like Terminal.

I'm lucky that my mouse was immediately recognized (I'm sure there's ways to delve further once this has been stirred), allowing me to click things which were otherwise completely stymied (like "install"), through one short terminal command: blued . The Bluetooth daemon kicked up and gave MAC addresses for probably two devices I have currently battery powered, and around. Hope that helps others, rather than forcing us all to get/keep USB wired mice around, dust free, and in workable condition.

Other extraneous USB pointing devices failed where this method succeeded for me. The computer I am working with has a fully powered and interactive Wacom Bamboo tablet-- this doesn't get anyone anywhere since I'm sure drivers aren't included/loaded at the point I found myself.

random
  • 15,201