microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
doc/debugging.md
28lines · modeblame
2af998b7Vladimir Kotikov8 years ago | 1 | # Setting up debug environment |
| 2 | | |
| 3 | Once 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 |  | |
| 6 | | |
| 7 | For example, you can modify the `target` field to specify the simulator you want to target for iOS debugging. | |
| 8 | | |
| 9 | ## Debugging with TypeScript and Haul | |
| 10 | If you use Haul instead of the react-native packager, you must add `sourceMapPathOverrides` to the `launch.json` file. | |
| 11 | | |
| 12 | For example: | |
| 13 | ``` | |
| 14 | "sourceMapPathOverrides": { | |
| 15 | "webpack:///./~/*": "${workspaceRoot}/node_modules/*", | |
| 16 | "webpack:///./*": "${workspaceRoot}/*", | |
| 17 | "webpack:///*": "*" | |
| 18 | } | |
| 19 | ``` | |
| 20 | See more about source map overrides [here](https://github.com/Microsoft/vscode-node-debug2#sourcemappathoverrides) | |
| 21 | | |
| 22 | ## Debugging on iOS device | |
| 23 | Debugging on an iOS device require following manual steps: | |
| 24 | * Install [ios-deploy](https://www.npmjs.com/package/ios-deploy) `npm install -g ios-deploy`. | |
| 25 | * Have a valid iOS Development certificate installed. | |
| 26 | * 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. `"arguments": [ "--device", "My iPhone" ]` | |
| 27 | * Choose **Debug iOS** configuration from the Configuration dropdown and press F5. | |
| 28 | * Shake the device to open the development menu and select "Debug JS Remotely". |