microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3d97c2a334a6b16ef7dfc654b8b33e23dac3f01a

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/android/androidPlatform.ts

27lines · modeblame

e639e7a4Daniel10 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 * as Q from "q";
eb2a5b33dlebu10 years ago5import {IMobilePlatform} from "../platformResolver";
6import {IRunOptions} from "../launchArgs";
7import {CommandExecutor} from "../../utils/commands/commandExecutor";
8import {Package} from "../../utils/node/package";
e639e7a4Daniel10 years ago9
10/**
11* Android specific platform implementation for debugging RN applications.
12*/
13export class AndroidPlatform implements IMobilePlatform {
14public runApp(runOptions: IRunOptions): Q.Promise<void> {
eb2a5b33dlebu10 years ago15return new CommandExecutor(runOptions.projectRoot).spawn("react-native", ["run-android"]);
e639e7a4Daniel10 years ago16}
17
18public enableJSDebuggingMode(runOptions: IRunOptions): Q.Promise<void> {
19let pkg = new Package(runOptions.projectRoot);
20return pkg.name()
21.then(name => {
eb2a5b33dlebu10 years ago22let enableDebugCommand = `adb shell am broadcast -a "com.${name.toLowerCase()}.RELOAD_APP_ACTION" --ez jsproxy true`;
e639e7a4Daniel10 years ago23let cexec = new CommandExecutor(runOptions.projectRoot);
24return cexec.execute(enableDebugCommand);
25});
26}
27}