microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.4.3

Branches

Tags

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

Clone

HTTPS

Download ZIP

doc/customization.md

94lines · modeblame

2af998b7Vladimir Kotikov8 years ago1# Customization
2
3There are a few customizations supported by this extension; they can be added to your `.vscode/settings.json` if you need them.
4
5## Specifying custom arguments for `react-native run-*` command
6
7For using custom run arguments for `react-native run-<platform>`:
8* **Note:** This overrides all other configuration parameters.
9
10```
11{
12"react-native.android.runArguments.simulator": ["--appFolder, "/Users/test/AwesomeProject/android/app", "--deviceId", "emulator-5555"],
13"react-native.ios.runArguments.device": ["--project-path", "ios", "--device", "Max's iPhone"],
14}
15```
16
17* **Note:** You can get the list of installed simulator devices by:
18
19iOS devices(MacOS only):
20
21```
22xcrun simctl list --json devices
23```
24
25Android devices:
26
27```
28adb devices
29```
30
31* **Note:** If you want run application on iOS devices make sure you have `ios-deploy` installed globally.
32
33```npm install -g ios-deploy```
34
35## Setting up the react-native packager
36
37To use a custom port for the `react-native` packager:
38
39```
40{
41"react-native": {
42"packager" : {
43"port": portNumber
44}
45}
46}
47```
48
b57ea017Artem Egorov8 years ago49If you change this port, then for iOS device and simulator scenarios you will have to modify the native code files. Instruction [here](https://blog.binoy.io/running-react-native-on-a-different-port-7deb43887cd4).<br>
50If you use android, you need to change debug server by:
511. CTRL+M(CMD+M) in the emulator
522. Go to Dev Settings
533. Debug server host for device => enter ‘localhost:\<yourPortNumber\>’.
544. Reload application (double R)
55
56* Note that some aspects of React Native hard-code the port to the default as specified in [this issue](https://github.com/facebook/react-native/issues/9145).
2af998b7Vladimir Kotikov8 years ago57
58## Logging
59
60To expose internal logs to the output, set the following properties:
61
62```
63{
64"react-native-tools": {
65"logLevel": "Trace"
66}
67}
68```
69
70`logLevel` can be `None` (no logs), `Error`, `Warning`, `Info`, `Debug`, `Trace` (all logs). Default is `None`.
71
72## Project structure
73
74To specify a subfolder in which the react-native project is located, set `react-native-tools.projectRoot`. You can use either an absolute or relative path here:
75
76```
77{
78"react-native-tools": {
79"projectRoot": "./your/react-native/project"
80}
81}
82```
83
84## TypeScript
85
86To use a different `TypeScript TSDK` version than the one that comes with VS Code, set the following:
87
88```
89{
90"typescript": {
91"tsdk": "path/to/tsdk"
92}
93}
94```