question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Debugging] Please make debug port (8081) configurable

See original GitHub issue

Port 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:closed
  • Created 8 years ago
  • Comments:38 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
ktononcommented, Jan 18, 2017

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-native package.

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 postinstall setting it to react-native-port-patcher --new-port=8088 (or whatever port you want). You can leave out the --new-port as 8088 is the default.

5reactions
haitang3009commented, Apr 24, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found