2

Recent changes to my machine as the result of an upgrade to Yosemite (OS X 10.10) have made my machine visible on Bluetooth and Bonjour, where it was not visible before.

Is there a command line way to disable/enable the relevant features so that my machine can be restored to "invisibility" to these services (e.g. when I'm in a less secure environment)?

0

2 Answers 2

6

Bonjour

Prior, to Yosemite this could be done via launchctl, so using:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

would turn Bonjour off, and to turn it back on:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Unfortunately /usr/sbin/mDNSResponder is not found on Yosemite.

A bit of digging and this seems to work for Bonjour:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

NB: I'm not clear if this means it stays off, it should given launchctl behaviour but I've have not had time to test it and determine if anything else in the system will turn it back on.

Bluetooth

Presuming you're talking about your Mac's built-in bluetooth and not a third party adaptor, then:

networksetup -listallnetworkservices

Lists all services, usually show Bluetooth as 'Bluetooth DUN'

killall blued

Kills the bluetooth server process

Launchctl commands

launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist

Unload the bt daemon

launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

Reload the bt daemon

launchctl start com.apple.blued

Restart blued daemon

2
  • 1
    Is there a way to just take BT out of "advertising mode" (or is that what the above does)?
    – orome
    Commented Oct 22, 2014 at 17:07
  • 2
    Came across this while looking to reconnect my trackpad to bluetooth. Even with the above bluetooth wouldn't shut off (killall blued couldn't find the process). This article did the trick for me: macissues.com/2015/05/07/… Replicate what happens at boot: sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    – notacouch
    Commented May 22, 2015 at 15:52
4

As mentioned by notacouch, cppl's answer doesn't work on Yosemite as killall blued doesn't find the process.

As recommended on notacouch shared URL's you need to do this: Open the Terminal utility

Run the following two commands:

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport;
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

When done, if Bluetooth is off then turn it back on and choose your devices from the Bluetooth menu. As a quick tip, you can select both of the commands above and then drag the selection to a Finder window, to create a text clipping of them in a convenient location (such as your Desktop). You can then quickly run the commands by dragging the clipping to a new Terminal window.

For more details follow this URL

You must log in to answer this question.

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