How to enable Bluetooth in Mac with shortcut or command line?

62

12

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?

Jooke

Posted 2010-01-07T19:37:38.050

Reputation:

what if my keyboard is also bluetooth ? – john Smith – 2014-08-06T10:13:17.460

@johnSmith in this case I used my other mac to remote desktop / screen share :) and enabled it remotely. – Nik Todorov – 2017-11-25T23:21:32.827

6I can just imagine the :facepalm: when you realized what happened. Hope someone has the right answer for you. :) – JMD – 2010-01-07T19:47:39.980

Answers

99

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.

netnichols

Posted 2010-01-07T19:37:38.050

Reputation: 1 091

This really is the best solution that I've found to this problem. Very quick to execute, and easy to remember. – tobylaroni – 2018-08-15T12:40:36.210

This worked better for me, as I have the function keys set to control playback, and Control+F7 wasn't enabling full keyboard access... Thanks! – geerlingguy – 2011-06-22T14:31:08.703

2This worked well for me because the On checkbox in the Bluetooth preferences pane was not selectable :-( OS X Lion – Bennett Dill – 2012-02-01T17:18:50.677

1This worked way better for me than fideli's answer which got me all the way to bluetooth settings but I could not tab to the on check box. This was also lot faster and easier. – JD Isaacks – 2013-01-16T15:19:39.237

1Elegant and functional — this was an awesome answer. – ehfeng – 2014-04-16T20:34:19.677

26

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

martin clayton

Posted 2010-01-07T19:37:38.050

Reputation: 1 012

3I installed this via brew and the on command was blueutil power 1 – Nick – 2015-05-21T20:56:26.963

Best answer to this question! – Vishal – 2018-08-08T02:24:33.250

1Sorry if this comment runs counter to (necro) etiquette on this Stack, but I thought it might add something useful... Here's the blueutil-based Bash script I use to toggle Bluetooth on/off: if [[ $(blueutil status) == 'Status: off' ]] ; then blueutil on ; else blueutil off ; fi. If you bind this script to a keyboard shortcut e.g. via Karabiner you get a Bluetooth toggle without resorting to some hacky key event solution. – Bert Zangle – 2018-10-27T17:58:06.473

Thanks! The best and efficient answer. I have installed with "brew install blueutil" command. "blueutil -p toggle" works without any problem on Mac OS Mojave 10.14.6. If bluetooth power is on, it makes it off. If bluetooth power is off, it makes it on. – csonuryilmaz – 2019-12-17T02:42:02.137

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.

fideli

Posted 2010-01-07T19:37:38.050

Reputation: 13 618

41-3 can be replaced with: ⌘-space; type "sys"; hit enter. (⌘-space launches Spotlight.) – Jonik – 2010-03-06T19:35:06.167

This is a great answer! – Josh – 2010-03-10T20:09:34.907

In 10.10.5: Ctrl F7 didn't work for me either; I did manage to get the "Turn Bluetooth On" highlighted but pressing enter didn't do anything. – jcollum – 2016-03-08T18:33:49.243

Damn, nice spacebar trick! I tried pressing enter so many times with no luck. – jakecraige – 2016-04-19T17:50:32.057

1- 3 can be replaced with Option-"brilliance" (on F2 key in my keyboard). That will bring up the system preferences panel. – Agustí Sánchez – 2017-03-12T09:22:11.900

1Can't highlight the On checkbox with tabbing... change in snow leopard? – mbrownnyc – 2011-09-01T02:39:30.657

The last paragraph was the one I needed, thanks! – MikeSchinkel – 2011-12-04T06:33:23.750

1-4 can be replaced with: ⌘-space; type "blue"; select Bluetooth, hit enter. (⌘-space launches Spotlight.) :-) – neu242 – 2012-08-17T09:52:14.333

Ctrl+F7 didn't work for me on Mavericks 10.9.3, but the BlueTooth File Exchange approach worked nicely. – Dennis Wurster – 2014-06-13T13:45:00.310

7

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

Posted 2010-01-07T19:37:38.050

Reputation: 7 540

This is arguably better than any of the other answers :). Very little technical knowledge required. – msouth – 2014-12-22T16:25:54.570

But what if you don't have a wired keyboard or mouse - only Bluetooth ones? As far as I can tell the computer won't enable Bluetooth even with a reboot. – Ed Avis – 2015-03-23T18:19:19.040

I believe that the login screen will automatically enable Bluetooth if there's no HID devices connected. I'll look for a reference tonight – Josh – 2015-03-23T18:20:52.790

1Following some instructions elsewhere, I unplugged everything from the iMac, plugged back just the power cord, and then switched it on. That worked (after a short delay at the login screen when it appeared not to). – Ed Avis – 2015-03-24T09:46:43.870

3

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

Posted 2010-01-07T19:37:38.050

Reputation: 98 421

For Yosemite 10.10.3 I had to replace 'click checkbox "On" of window "Bluetooth"' with 'click button "Turn Bluetooth Off" of window "Bluetooth"' – None – 2015-07-01T18:08:37.080

I just get an error which suggests that application System Events isn't running? – Chris F Carroll – 2019-05-15T10:45:09.057

3

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

Posted 2010-01-07T19:37:38.050

Reputation: 131

Worked on Mavericks, too! – Dennis Wurster – 2014-06-13T13:41:23.387

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

Posted 2010-01-07T19:37:38.050

Reputation: 8 755

2

  • Press Space, write "bluetooth".
  • Press the following combination: FnF7. A light blue frame appears arround the activate box.
  • Press spacebar, finished!

ASA

Posted 2010-01-07T19:37:38.050

Reputation:

The sequence Fn⌃F7 activates full keyboard access; once you've turned it on you'll be able to simply tab between the control elements in the window. – Josh Ourisman – 2012-10-31T15:17:24.547

2

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.

Pixxit

Posted 2010-01-07T19:37:38.050

Reputation: 51

1This sounds like a Windows keyboard shortcut instead of a OS X shortcut. – Ramhound – 2014-10-07T18:40:23.177

3I don't really know why anyone down-voted this response. Maybe they didn't actually put in the effort to try it and see it does give a bit of help ? @Ramhound it actually works. I just tested it on my MacBook. I hold down the Fn + CTRL then strike the F8 key and voila ! It selects the Bluetooth in the menubar. With the wired keyboard, the user would then be able to navigate the Bluetooth menu to select his bluetooth settings and reactive his mouse/keyboard. So, yes, it's actually a OS X shortcut, not a Windows shortcut. – Danijel-James W – 2016-04-29T01:41:09.467

1And just to add to this, I think it's ridiculous we all go and down-vote a new user for what reason without at least adding some comments to their answer to be more productive so we know and they know where in future it might be more clear or helpful. I don't know when the votes came in, before or after the comment about this sounding like it's a Windows keyboard shortcut. Did anyone actually bother to try this and compare it against the results of other users ? I don't think so. – Danijel-James W – 2016-04-29T01:46:01.623

The comment was CTRL+F8 not FN+CTRL+F8. I made the comment nearly 2 years, the answer honestly, seems incomplete. I don't find short answers like this very helpful, compared to the other answers, this was a late answers to an old question after 4 years. – Ramhound – 2016-04-29T11:30:17.360

I like the answer and I do not think it deserves down vote - in my mac is configured to use F8 (and all F keys) directly without the need to press fn first. So this answer worked perfectly for me, but the answers above the mentioned fn + Ctrl + F7, for example, did not. Do I need to downvote them - No afcource! Read and try and do not downvote unless it is really off topic. – Nik Todorov – 2017-11-25T23:18:48.033

I upvoted you. You can change the default behaviour of the F keys, they can act as an F key or as the symbol on them suggests, like volume and stuff. That's why sometimes it works with fn+ctrl and sometimes just with ctrl. – Cristi Băluță – 2018-03-23T12:08:34.947

Or, you know, we could edit the answer to clarify the keyboard setting. – Chris F Carroll – 2019-05-16T12:56:17.533

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!

Elina

Posted 2010-01-07T19:37:38.050

Reputation: 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.

Pankaj Bajoria

Posted 2010-01-07T19:37:38.050

Reputation: 11

1

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)

Mike Rosen

Posted 2010-01-07T19:37:38.050

Reputation: 11

0

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.

Jonathan O'Keeffe

Posted 2010-01-07T19:37:38.050

Reputation: 1

0

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
    

Paulo Henrique Lellis Gonalves

Posted 2010-01-07T19:37:38.050

Reputation: 101

0

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.
  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.

Vignesh Raja

Posted 2010-01-07T19:37:38.050

Reputation: 101

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.

lookmomnohands

Posted 2010-01-07T19:37:38.050

Reputation: 1