Add the configuration option to the run-android command

Summary:
Currently, to generate a `Release` build in `Android` it is required to get into the `android` directory and run the `react native bundle`with a lot of options and after that run the `gradle` to assemble or install the application with the build type `Release`.

This PR improves the process adding that feature to the `React Native CLI`.

To generate a release build is only required to use the parameter `--configuration` with the value `Release`.

**Examples**

To generate a release build:
```sh
react-native run-android --configuration release
```

To generate a release build for the product flavors staging:
```sh
react-native run-android --configuration release --flavor staging
```

To generate a debug build:
```sh
react-native run-android
```

To generate a debug build for the product flavors staging:
```sh
react-native run-android --flavor staging
```

This PR also removes the option `--install-debug` from the `react-native run-android` because that is always the default value,
Closes https://github.com/facebook/react-native/pull/10867

Differential Revision: D4167203

Pulled By: cpojer

fbshipit-source-id: c5ac07f81feeeea00ee0e8b059b46ef0d258a1a6
This commit is contained in:
Sandro Machado
2016-11-13 18:49:49 -08:00
committed by Facebook Github Bot
parent 39cf29c0f7
commit 2a2d3c6e5a
2 changed files with 33 additions and 13 deletions

View File

@@ -148,6 +148,10 @@ $ react-native run-android
> If you get a "bridge configuration isn't available" error, see [Using adb reverse](#using-adb-reverse).
> Hint
>
> You can also use the `React Native CLI` to generate and run a `Release` build (e.g. `react-native run-android --configuration Release`).
<block class="mac windows linux android ios" />
## Connecting to the development server