1.6 KiB
1.6 KiB
id | title | layout | category | permalink | next |
---|---|---|---|---|---|
debugging | Debugging | docs | Guides | docs/debugging.html | testing |
Debugging React Native Apps
To debug the javascript code of your react app do the following:
- Run your application in the iOS simulator.
- Press
Command + D
and a webpage should open up at http://localhost:8081/debugger-ui. (Chrome only for now) - Enable Pause On Caught Exceptions for a better debugging experience.
- Press
Command + Option + I
to open the Chrome Developer tools, or open it viaView
->Developer
->Developer Tools
. - You should now be able to debug as you normally would.
Hint
To debug on a real device: Open the file
RCTWebSocketExecutor.m
and changelocalhost
to the IP address of your computer. Shake the device to open the development menu with the option to start debugging.
Optional
Install the React Developer Tools extension for Google Chrome. This will allow you to navigate the view hierarchy if you select the React
tab when the developer tools are open.
Live Reload
To activate Live Reload do the following:
- Run your application in the iOS simulator.
- Press
Control + Command + Z
. - You will now see the
Enable/Disable Live Reload
,Reload
andEnable/Disable Debugging
options.