如何以编程方式在 OS X 中设置蓝牙可发现模式
有没有办法以编程方式在 OS X 中设置蓝牙可发现模式(真/假)?
而不是要求用户打开/关闭它?
Is there a way to set the Bluetooth Discoverable mode (true/false) in OS X programmatically?
Instead of asking the user to turn it on/off?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 OS X 专用 API IOBluetoothPreferenceSetDiscoverableState。
您可能还会发现用于打开和关闭蓝牙的 API 很有用:
You can use the OS X private API IOBluetoothPreferenceSetDiscoverableState.
You might also find useful the APIs for turning on and off bluetooth:
告诉应用程序“系统偏好设置”
结束告诉
这个苹果脚本将打开/关闭蓝牙可见性。希望这会有所帮助。
tell application "System Preferences"
end tell
This apple script will Switch On/Off Bluetooth visibility.Hope this will help.