microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3f381d8cbe397a4c94fbdcb93142cd2dc36ed84a

Branches

Tags

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

Clone

HTTPS

Download ZIP

doc/debugging.md

68lines · modecode

1# Setting up debug environment
2
3Once you have set up a `launch.json` file with default configurations, you can modify these configurations, or add new ones to the list. You can use other fields in these configurations as well.
4
5![React Native launch configuration file](../images/launch-config.png)
6
7For example, you can modify the `target` field to specify the simulator you want to target for iOS debugging or the device using the one from output of `adb devices` command for Android debugging.
8
9## Debugging with TypeScript and Haul
10
11If you use Haul instead of the react-native packager, you must add `sourceMapPathOverrides` to the `launch.json` file.
12
13For example:
14```
15"sourceMapPathOverrides": {
16 "webpack:///./~/*": "${workspaceRoot}/node_modules/*",
17 "webpack:///./*": "${workspaceRoot}/*",
18 "webpack:///*": "*"
19}
20```
21See more about source map overrides [here](https://github.com/Microsoft/vscode-node-debug2#sourcemappathoverrides)
22
23## Specifying scheme for iOS app
24
25If you want to use custom scheme for your application you can either pass it as part of `runArguments` parameter arguments or set `scheme` configuration parameter as shown below:
26```js
27"runArguments": ["--scheme", "customScheme", ...]
28// or
29"runArguments": ["--scheme=customScheme", ...]
30// or
31"scheme" : "customScheme"
32```
33Please be aware, specifying scheme value as a part of `runArguments` parameter arguments will override `scheme` configuration parameter value if it set.
34
35## Debugging on iOS device
36
37Debugging on an iOS device require following manual steps:
38* Install [ios-deploy](https://www.npmjs.com/package/ios-deploy) `npm install -g ios-deploy`.
39* Have a valid iOS Development certificate installed.
40* In your project's `launch.json` file set `target` to `device` or use 'launchArguments' property to specify particular device to run on in case of multiple devices connected, e.g. `"runArguments": [ "--device", "My iPhone" ]`
41* Choose **Debug iOS** configuration from the Configuration dropdown and press F5.
42* Shake the device to open the development menu and select "Debug JS Remotely".
43
44## Debugging React Native Windows
45
46For UWP apps use `windows` target platform in `launch.json` configuration, e.g.:
47
48```
49{
50 "name": "Debug UWP",
51 "program": "${workspaceRoot}/.vscode/launchReactNative.js",
52 "type": "reactnative",
53 "request": "launch",
54 "platform": "windows"
55}
56```
57
58For WPF apps use `wpf`, e.g.(WPF debugging available only for react-native-windows gt 0.55.0):
59
60```
61{
62 "name": "Debug WPF",
63 "program": "${workspaceRoot}/.vscode/launchReactNative.js",
64 "type": "reactnative",
65 "request": "launch",
66 "platform": "wpf"
67}
68```
69