Search code examples
iosxcodeios-simulatorsimulatorhomekit

How to use Home Kit Accessory Simulator


I am new to iOS programming...Can someone guide me, how to use Home Kit Accessory Simulator and from where can I get it.

I tried to setup my simulator like this but cant figure out, how to use it..

Simulator Image

Thanks, Soumyashree


Solution

  • Look at section Adding Services to Accessories in this Apple document: HomeKit Developer Guide

    Let's solve your problem with help of sample accessory service addition process, according to document, using an example of FAN.

    An accessory needs a service with characteristics that you can control from your app. You select a service from a predefined list and then customize the characteristics.

    To add a service to an accessory

    1. In HomeKit Accessory Simulator, select the accessory in the Accessories column.

    The services for the accessory appear in the detail view.

    enter image description here

    1. Click Add Service, and choose a type of service from the pop-up menu.
      The new service appears in the detail view. HomeKit Accessory Simulator creates the common characteristics for that type of service. For example, the default characteristics of a Light Bulb service are Hue, Saturation, Brightness, and On. (The On characteristic is the same as the power state characteristic type, described in Accessing Values of Characteristics.) Some characteristics are mandatory and others are optional. For example, the On characteristic is mandatory, and the Hue, Saturation, and Brightness characteristics are optional.

      enter image description here