Enabling HomeKit

HomeKit is an app service available only to apps distributed through the App Store. HomeKit requires additional configuration in your Xcode project. Your app must be provisioned and code signed to use HomeKit. To avoid code signing issues, enable HomeKit in the Xcode Capabilities pane. You don’t need to edit entitlements directly in Xcode or Member Center.

Setup

To perform all the steps in this document, you need:

Verify that you have performed these tasks before you begin using HomeKit. To create your team provisioning profile, read App Distribution Quick Start.

Task

../Art/checkbox_checked_2x.png

Join the iOS Developer Program.

../Art/checkbox_checked_2x.png

Create an Xcode project that builds and runs.

../Art/checkbox_checked_2x.png

Add your Apple ID to Accounts preferences.

../Art/checkbox_checked_2x.png

In the General pane, create your team provisioning profile:

  • Choose your team from the Team pop-up menu.

  • Click Fix Issue.

When you successfully complete the preceding tasks, the error message and the Fix Issue button below the Team pop-up menu in the General pane disappear. The screenshot below shows the General pane when the code signing assets are successfully created.

../Art/2_create_teamprofile_2x.png

To troubleshoot code signing and provisioning, read Troubleshooting in App Distribution Guide.

Enable HomeKit

To use HomeKit, you first enable it. Xcode will add the HomeKit entitlement to your entitlements file in the project and App ID in Member Center. Xcode also adds the HomeKit framework to your project. HomeKit requires an explicit App ID, which is created for you when you complete these steps.

To enable HomeKit

  1. In Xcode, choose View > Navigators > Show Project Navigator.

  2. Choose the target from the Project/Targets pop-up menu (or in the Product/Targets sidebar if it appears).

  3. Click Capabilities to view app services that you can add to your app.

  4. Scroll down to the HomeKit row and select the switch.

Download HomeKit Accessory Simulator

You don’t need to buy accessories to develop your HomeKit app. You can use HomeKit Accessory Simulator to test the communication of your HomeKit app with simulated accessories. HomeKit Accessory Simulator is not distributed with Xcode.

To download HomeKit Accessory Simulator

  1. In the HomeKit section of the Capabilities pane, click Download HomeKit Accessory Simulator.

    Alternatively, choose Xcode > Open Developer Tool > More Developer Tools.

  2. In a browser, search for and download the “Hardware IO Tools for Xcode” .dmg file.

  3. In the Finder, double-click the .dmg file in ~/Downloads.

  4. Drag HomeKit Accessory Simulator to the /Applications folder.

Later, you’ll test your app using HomeKit Accessory Simulator, as described in Testing Your HomeKit App.