microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
b031edc774df5bdef810349bdd6d2c40c7acfadd

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/ios/deviceDeployer.ts

32lines · 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 * as path from "path";
5import * as Q from "q";
6
7import {CommandExecutor} from "../../common/commandExecutor";
8import {Log} from "../../common/log";
9import {Xcodeproj} from "../../common/ios/xcodeproj";
10
11export class DeviceDeployer {
12 private projectRoot: string;
13
14 constructor(projectRoot: string) {
15 this.projectRoot = projectRoot;
16 }
17
18 public deploy(): Q.Promise<void> {
19 return new Xcodeproj().findXcodeprojFile(this.projectRoot).then((projectFile: string) => {
20 const projectName = path.basename(projectFile, path.extname(projectFile));
21 const pathToCompiledApp = path.join(this.projectRoot, "ios", "build",
22 "Build", "Products", "Debug-iphoneos", `${projectName}.app`);
23 return new CommandExecutor(this.projectRoot)
24 .spawnAndWaitForCompletion("ideviceinstaller", ["-i", pathToCompiledApp]).catch((err) => {
25 if (err.code === "ENOENT") {
26 Log.logError("Unable to find ideviceinstaller. Please make sure to install Homebrew (http://brew.sh) and then 'brew install ideviceinstaller'");
27 }
28 throw err;
29 });
30 });
31 }
32}