microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
52bf0a75506c1b3b1cecc9ad89937e596d1bc22a

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/android/androidPlatform.ts

28lines · 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";
f8d32439dlebu10 years ago5import {IAppPlatform} from "../platformResolver";
eb2a5b33dlebu10 years ago6import {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*/
f8d32439dlebu10 years ago13export class AndroidPlatform implements IAppPlatform {
bc7a32ceJimmy Thomson10 years ago14
e639e7a4Daniel10 years ago15public runApp(runOptions: IRunOptions): Q.Promise<void> {
f8d32439dlebu10 years ago16return new CommandExecutor(runOptions.projectRoot).spawnAndWaitReactCommand("run-android");
e639e7a4Daniel10 years ago17}
18
19public enableJSDebuggingMode(runOptions: IRunOptions): Q.Promise<void> {
20let pkg = new Package(runOptions.projectRoot);
21return pkg.name()
22.then(name => {
eb2a5b33dlebu10 years ago23let enableDebugCommand = `adb shell am broadcast -a "com.${name.toLowerCase()}.RELOAD_APP_ACTION" --ez jsproxy true`;
e639e7a4Daniel10 years ago24let cexec = new CommandExecutor(runOptions.projectRoot);
25return cexec.execute(enableDebugCommand);
26});
27}
28}