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..
Thanks, Soumyashree
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..
Thanks, Soumyashree
Here is an Apple document: Testing Your HomeKit App
If you don’t have physical accessories, use HomeKit Accessory Simulator to simulate accessories in a home. Each simulated accessory has services with characteristics that you can control from your app.
Adding Accessories
Use HomeKit Accessory Simulator to add some accessories to the simulated network.
To add an accessory to the network
In HomeKit Accessory Simulator, click the Add button (+) at the bottom of the left column.
Choose Add Accessory from the pop-up menu.
Enter an accessory name and manufacturer.
Enter an accessory name and manufacturer.
Click Finish
Note: Document also contains an information about how to create accessory services, if you want.
HomeKit Accessory Simulator is an additional developer tool that is not installed with Xcode. To install HomeKit Accessory Simulator, follow the steps in 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
In the HomeKit section of the Capabilities pane, click Download HomeKit Accessory Simulator.
Alternatively, choose Xcode > Open Developer Tool > More Developer Tools.
In a browser, search for and download the “Hardware IO Tools for Xcode” .dmg file.
In the Finder, double-click the .dmg file in ~/Downloads. Drag HomeKit Accessory Simulator to the /Applications folder.
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
The services for the accessory appear in the detail view.
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.