microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1.11.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/commands/launchIosSimulator.ts

22lines · modepreview

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.

import { ErrorHelper } from "../../common/error/errorHelper";
import { InternalErrorCode } from "../../common/error/internalErrorCode";
import { TargetType } from "../generalPlatform";
import { IOSTargetManager } from "../ios/iOSTargetManager";
import { Command } from "./util/command";

export class LaunchIOSSimulator extends Command {
    codeName = "launchIOSSimulator";
    label = "Launch iOS Simulator";
    requiresProject = false;

    error = ErrorHelper.getInternalError(InternalErrorCode.FailedToStartIOSSimulator);

    async baseFn(): Promise<void> {
        const targetManager = new IOSTargetManager();
        await targetManager.collectTargets(TargetType.Simulator);
        await targetManager.selectAndPrepareTarget(target => target.isVirtualTarget);
    }
}