A command-line WatchKit application launcher for the iOS Simulator.
This requires an Xcode that supports WatchKit. At the time of writing, it has been successfully used on:
- Xcode 6.2 beta 5
- Xcode 6.3 beta 1
And just as with Xcode, it doesn’t always boot properly the first (few) time(s)… 😭🐼 But will wait to see if Apple improves that before looking into it myself.
$ git clone https://github.com/alloy/watch-sim.git
$ cd watch-sim
$ make install [PREFIX=/usr/local]
$ watch-sim path/to/build/WatchHost.app \
-display [Compact|Regular] -type [Glance|Notification] \
-notification-payload [path/to/payload.json] -verbose [YES|NO] \
-start-suspended [YES|NO] -developer-dir [Xcode.app/Contents/Developer]
The launcher does not build applications, as the name implies, it is only meant to launch
applications. As such, you will first have to create a build of your application with your favorite
build tool and then point watch-sim
at it.
The WatchHost.app
is your normal iPhone application, not the SockPuppet application that
gets embedded in your normal iPhone application.
-display [Compact|Regular]
The Apple Watch device to simulate, which correspond to respectively the 38mm and the 42mm devices.
This defaults to Regular
.
-type [Glance|Notification]
The type of WatchKit application interface to simulate.
This defaults to nil
, which corresponds to the normal full WatchKit application.
In the case of a Notification
application interface, you are required to specify the
-notification-payload
option.
-notification-payload [path/to/payload.json]
The data payload used to populate a Notification
WatchKit application interface with.
An example payload file is generated by Xcode when adding a WatchKit application with Notification interface to your project.
This is required when the -type Notification
option is specified.
-verbose [YES|NO]
Whether or not to log the steps being taken to the console.
Defaults to NO
.
-start-suspended [YES|NO]
Whether or not to immediately finish launching the application once the debugger has attached.
You can use this to set additional breakpoints before the application has a chance to run any of your own code.
Defaults to NO
.
-developer-dir [Xcode.app/Contents/Developer]
The installation location of an Xcode application bundle that provides support for WatchKit applications.
Defaults to the DEVELOPER_DIR
environment variable, if set, or xcode-select -p
.
I would have called this program ‘Nanny’, as in ‘WatchKit’ -> ‘watch kid’ -> ‘nanny’. Would it have been a stretch? Yeah, I thought as much. Reality, such a major bummer.