title: Emulate a Bluetooth keyboard on Mac
body: <p>I'm trying to build an application for mac that can emulate mac to an Bluetooth keyboard.
  after reading <a href="https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/" rel="nofollow noreferrer"><strong>《HID over GATT Profile 1.0》</strong></a> and other <a href="https://www.bluetooth.com/specifications/specs/" rel="nofollow noreferrer">Bluetooth document</a>, I trying to use Apple's <a href="https://developer.apple.com/documentation/corebluetooth" rel="nofollow noreferrer">Core Bluetooth</a> framework to do this. But after called
  <code>myPeripheralManager.add(hid_service)</code> I got an error message :</p>
  <pre><code>Error Domain=CBErrorDomain Code=8 &quot;The specified UUID is not allowed for this operation.&quot; UserInfo={NSLocalizedDescription=The specified UUID is not allowed for this operation.}
  </code></pre>
  <p>The UUID of service is:</p>
  <ul>
  <li>HID Service : 0x1812</li>
  <li>Device Information Service : 0x180A</li>
  <li>Battery Service : 0x180F</li>
  </ul>
  <p>It does appear that Apple prevents the HID service from working on Mac acting as a peripheral.</p>
  <p>But some app like <strong><a href="https://bluetooth-keyboard.com/" rel="nofollow noreferrer">Key Pad</a></strong> actually can do this on mac.</p>
  <p>What way can circumvent Apple's restriction?</p>