microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/v-peq/add-network-inspector-server-tests

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/extension/ios/simctl.ts

24lines · modecode

1// 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 {
9 public static async getBootediOSSimulatorList(): Promise<string[]> {
10 const getBootedSimulatorCommand =
11 "xcrun simctl list | awk -F'[()]' '/(Booted)/ { print $2 }'";
12
13 const targetResult = await childProcess.execToString(getBootedSimulatorCommand);
14 const targetList = targetResult.split("\n");
15 return targetList;
16 }
17
18 public static async installApplicationToSimulator(
19 targetId: string,
20 appPath: string,
21 ): Promise<void> {
22 await childProcess.execFileToString("xcrun", ["simctl", "install", targetId, appPath]);
23 }
24}
25