A Cake Build addin for managing (simctl) Apple iOS/watchOS/TV simulators is now available via NuGet or GitHub.

Installation

Add the following reference to your cake build script:

#addin "Cake.AppleSimulator"

Usage

// erase/factory reset, then power on an iPhone 6.3 simulator running iOS 9.3 and then shut it down.
IReadonlyList<AppleSimulator> simulator = ListGenymotionSimulators();

var simulator = simulators.First(x => x.Name == "iPhone 6s" & x.Runtime == "iOS 9.3");
var deviceIdentifier = simulator.UDID;

EraseAppleSimulator(deviceIdentifier);

// launch simulator currently does not block, you will need to sleep the cake
// thread for enough time to allow the simulator to boot.
LaunchAppleSimulator(deviceIdentifier);

using System.Threading;
Thread.Sleep(15000);

ShutdownAllAppleSimulators(deviceIdentifier)

Administration

void EraseAppleSimulator(string deviceIdentifier);
void BootAppleSimulator(string deviceIdentifier)
void LaunchAppleSimulator(string deviceIdentifier)
void ShutdownAllSimulators();

List defined simulators

IReadonlyList<AppleSimulator> ListAppleSimulators();

public sealed class AppleSimulator
{
    public string Availability { get; set; }
    public string Name { get; set; }
    public string Runtime { get; set; }
    public string State { get; set; }
    public string UDID { get; set; }
}

List defined simulator pairings

IReadonlyList<AppleSimulatorPair> ListAppleSimulatorPairs();

public sealed class AppleSimulatorPair
{
    public string State { get; set; }
    public string UDID { get; set; }
    public AppleSimulatorPairedPhone Phone { get; set; }
    public AppleSimulatorPairedWatch Watch { get; set; }
}

public sealed class AppleSimulatorPairedPhone
{
    public string Name { get; set; }
    public string State { get; set; }
    public string UDID { get; set; }
}

public sealed class AppleSimulatorPairedWatch
{
    public string Name { get; set; }
    public string State { get; set; }
    public string UDID { get; set; }
}

List installed simulator runtimes

IReadonlyList<AppleSimulatorRuntime> ListAppleSimulatorRuntimes();

public sealed class AppleSimulatorRuntime
{
    public string Availability { get; set; }
    public string BuildVersion { get; set; }
    public string Identifier { get; set; }
    public string Name { get; set; }
    public string Version { get; set; }
}

List installed simulator devicetypes

IReadonlyList<AppleSimulatorDeviceType> ListAppleSimulatorDeviceTypes();

public sealed class AppleSimulatorDeviceType
{
    public string Identifier { get; set; }
    public string Name { get; set; }
}

The future

The infrastructure for the following is in place but not implemented, open an issue on GitHub, discuss and then send in a PR. Cheers!