microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.4.2

Branches

Tags

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

Clone

HTTPS

Download ZIP

doc/customization.md

89lines · modecode

1# 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
19 iOS devices(MacOS only):
20
21 ```
22 xcrun simctl list --json devices
23 ```
24
25 Android devices:
26
27 ```
28 adb 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
49If you change this port, then for iOS device and simulator scenarios you will have to modify the native code entry point in `AppDelegate.m` to reflect the new port number.
50For Android, the extension uses `adb reverse` to tunnel the default port `8081` on the device to the specified port on the local machine, so no further configuration should be necessary. 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).
51
52## Logging
53
54To expose internal logs to the output, set the following properties:
55
56```
57{
58 "react-native-tools": {
59 "showInternalLogs": true,
60 "logLevel": "Trace"
61 }
62}
63```
64
65`logLevel` can be `None` (no logs), `Error`, `Warning`, `Info`, `Debug`, `Trace` (all logs). Default is `None`.
66
67## Project structure
68
69To 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:
70
71```
72{
73 "react-native-tools": {
74 "projectRoot": "./your/react-native/project"
75 }
76}
77```
78
79## TypeScript
80
81To use a different `TypeScript TSDK` version than the one that comes with VS Code, set the following:
82
83```
84{
85 "typescript": {
86 "tsdk": "path/to/tsdk"
87 }
88}
89```
90