"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const yok_1 = require("../../yok");
class Wp8EmulatorServices {
    static get programFilesPath() {
        return process.arch === "x64"
            ? process.env["PROGRAMFILES(X86)"]
            : process.env.ProgramFiles;
    }
    constructor($logger, $childProcess) {
        this.$logger = $logger;
        this.$childProcess = $childProcess;
    }
    async getEmulatorId() {
        return "";
    }
    async getRunningEmulator(image) {
        return null;
    }
    async getRunningEmulatorImageIdentifier(emulatorId) {
        return null;
    }
    async getRunningEmulatorIds() {
        return [];
    }
    async startEmulator() {
        return null;
    }
    async runApplicationOnEmulator(app, emulatorOptions) {
        this.$logger.info("Starting Windows Phone Emulator");
        const emulatorStarter = this.getPathToEmulatorStarter();
        this.$childProcess
            .spawn(emulatorStarter, ["/installlaunch", app, "/targetdevice:xd"], {
            stdio: "ignore",
            detached: true,
        })
            .unref();
    }
    async getEmulatorImages() {
        return { devices: [], errors: [] };
    }
    async getRunningEmulators() {
        return [];
    }
    async getRunningEmulatorName() {
        return "";
    }
    getPathToEmulatorStarter() {
        return path.join(Wp8EmulatorServices.programFilesPath, Wp8EmulatorServices.WP8_LAUNCHER_PATH, Wp8EmulatorServices.WP8_LAUNCHER);
    }
}
Wp8EmulatorServices.WP8_LAUNCHER = "XapDeployCmd.exe";
Wp8EmulatorServices.WP8_LAUNCHER_PATH = "Microsoft SDKs\\Windows Phone\\v8.0\\Tools\\XAP Deployment";
yok_1.injector.register("wp8EmulatorServices", Wp8EmulatorServices);
