5

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

Krunal
  • 77,632
  • 48
  • 245
  • 261
  • What have you tried so far? Show us some effort, we're not going to google for you! – cguedel Feb 27 '18 at 09:05
  • @cguedel.. I have attached a screenshot, take a look at that and see that I have tried.. –  Feb 27 '18 at 09:16

2 Answers2

1

Here is an Apple document: Testing Your HomeKit App

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.

  1. Choose Add Accessory from the pop-up menu.

  2. Enter an accessory name and manufacturer.

  3. Enter an accessory name and manufacturer.

  4. Click Finish

    enter image description here

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.

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.

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

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

  4. In the Finder, double-click the .dmg file in ~/Downloads. Drag HomeKit Accessory Simulator to the /Applications folder.

Community
  • 1
  • 1
Krunal
  • 77,632
  • 48
  • 245
  • 261
  • 1
    Thanks for your detailed reply...I had followed these steps and created a light bulb...But without any real device , how I am going to test like its ON or OFF ?? –  Feb 27 '18 at 09:39
  • @Krunal...Thanks for your help...But before your post, I had already done this...MY problem is that I am not going to figure out, How to test it.... –  Feb 27 '18 at 09:57
  • Try this tutorial http://www.xmcgraw.com/learn-how-to-create-an-ios-app-using-homekit/ – anoop4real Apr 02 '18 at 17:49
  • The “Hardware IO Tools for Xcode” package is outdated... since Xcode 8 the HomeKit Accessory Simulator is provided with “Additional Tools for Xcode” https://developer.apple.com/download/more/?=Additional%20Tools%20for%20Xcode – gutch Jun 24 '18 at 02:10
0

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

Krunal
  • 77,632
  • 48
  • 245
  • 261