[Debugging] Please make debug port (8081) configurable
See original GitHub issuePort 8081 is currently used by react-native as the debugging port in the following files:
Libraries/RCTTest/RCTTestRunner.m
Libraries/WebSocket/RCTWebSocketExecutor.m
React/Base/RCTRedBox.m
React/React.xcodeproj/project.pbxproj
Unfortunately there are other services that might use 8081, i.e. McAfee:
| Port | Default | Description | Traffic direction |
|---|---|---|---|
| Agent wake-up communication port SuperAgent repository port | 8081 | TCP port that agents use to receive agent wake-up requests from the ePO server or Agent Handler… | Inbound connection from the ePO server/Agent Handler to the McAfee Agent… |
See https://kc.mcafee.com/corporate/index?page=content&id=KB66797
Another reason for having a configurable react-native debug port is that I often work on two react-native projects in parallel, i.e. my own project plus UIExplorer. But both react-native apps collide, because both want to use port 8081.
Please make react-native’s debug port configurable in order to avoid conflicts with other services.
Issue Analytics
- State:
- Created 8 years ago
- Comments:38 (7 by maintainers)
Top Results From Across the Web
Unable to open debugger port in IntelliJ IDEA - Stack Overflow
If you run the application, it will go through the port you have Tomcat configured for, 8080, 8081 or whatever. But if you...
Read more >Allow packager port to be configurable (change from 8081)
* Step 2: Once the app starts, press Ctrl-M+M and in "Dev Settings" enter "10.0.2.2:8088". You have to do this only once (that...
Read more >handshake failed error with Remote Debugging
In your case, remote debugger needs to connect to the JVM that is already running in debug mode. Make sure you start the...
Read more >8 Ways to Debug your React Native App with Expo - Medium
To configure the port React Native Debugger is listening to, choose Open Config File from Debugger menu item at the top, update ...
Read more >Debugging React Native with react-native-debugger
After launching React Native Debugger, change the port to 19000 (if using SDK = 39, the port should be 19001). Then, with expo...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I couldn’t figure out how to get this working following any of the solutions I found online. I found the only reliable way was to replace all occurrences of the hard coded port in the
react-nativepackage.I published an npm package to do this: https://github.com/ktonon/react-native-port-patcher
Just install it as a dependency, then add a script for
postinstallsetting it toreact-native-port-patcher --new-port=8088(or whatever port you want). You can leave out the--new-portas8088is the default.Hello there,
I have fixed this issue by the step below: if you installed McAfee antivirus, the default port of McAfee log is 8081. You should manual change the port of your react native server
Step 1: go to <your app>\node_modules\react-native\local-cli\server\server.js and change the port 8081 to 8088
const args = parseCommandLine([{ command: ‘port’, default: 8088, type: ‘string’, }
Step 2: Create an “assets” folder under “android/app/src/main”
Step 3: in node.js run “react-native start” and navigate to the url “http://localhost:8088/index.android.bundle?platform=android”
Step 4: save the bundle to assets folder and you are all set. in node.js run “react-native run-android” to view the result
Regards,
Hai Tang