microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0502b7a86030ea91bf3320d0f2ad32aff86fa6db

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/android/androidPlatform.ts

31lines · 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";
b0061ac6Meena Kunnathur Balakrishnan10 years ago7import {CommandExecutor} from "../../common/commandExecutor";
8import {Package} from "../../common/node/package";
8953be57dlebu10 years ago9import {PackageNameResolver} from "../../common/android/packageNameResolver";
e639e7a4Daniel10 years ago10
11/**
12* Android specific platform implementation for debugging RN applications.
13*/
f8d32439dlebu10 years ago14export class AndroidPlatform implements IAppPlatform {
bc7a32ceJimmy Thomson10 years ago15
e639e7a4Daniel10 years ago16public runApp(runOptions: IRunOptions): Q.Promise<void> {
f8d32439dlebu10 years ago17return new CommandExecutor(runOptions.projectRoot).spawnAndWaitReactCommand("run-android");
e639e7a4Daniel10 years ago18}
19
20public enableJSDebuggingMode(runOptions: IRunOptions): Q.Promise<void> {
21let pkg = new Package(runOptions.projectRoot);
8953be57dlebu10 years ago22
e639e7a4Daniel10 years ago23return pkg.name()
2010d4e2dlebu10 years ago24.then(appName => new PackageNameResolver(appName).resolvePackageName(runOptions.projectRoot))
8953be57dlebu10 years ago25.then(packageName => {
26let enableDebugCommand = `adb shell am broadcast -a "${packageName.toLowerCase()}.RELOAD_APP_ACTION" --ez jsproxy true`;
e639e7a4Daniel10 years ago27let cexec = new CommandExecutor(runOptions.projectRoot);
28return cexec.execute(enableDebugCommand);
29});
30}
31}