microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
test-microbuild1

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/extension/ios/simctl.ts

25lines · modeblame

2a485fd5Ezio Li2 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import { ChildProcess } from "../../common/node/childProcess";
5
6const childProcess: ChildProcess = new ChildProcess();
7
8export class SimctrlHelper {
9public static async getBootediOSSimulatorList(): Promise<string[]> {
10const getBootedSimulatorCommand =
11"xcrun simctl list | awk -F'[()]' '/(Booted)/ { print $2 }'";
12
13const targetResult = await childProcess.execToString(getBootedSimulatorCommand);
14const targetList = targetResult.split("\n");
15return targetList;
16}
17
18public static async installApplicationToSimulator(
19targetId: string,
20appPath: string,
21): Promise<void> {
22const installCommand = `xcrun simctl install ${targetId} ${appPath}`;
23await childProcess.execToString(installCommand);
24}
25}