vikram jeet singh vikram jeet singh - 1 year ago 357
React JSX Question

React native change listening port

I am using react native android and having face issue to deploy the app on android device.
When I run

react-native start, it won't start dev sever on port 8081

enter image description here

I have tried few options mentioned at:


2) Tried to stop process running at port number 8081, but no success

My question is that can we change the react native dev server port from 8081 (which is default in android howwever the same we can change in ios from AppDelegate.m file) to some thing else or any other approach

Your responses will be highly appreciated. Thanks

Answer Source

Not sure if this is documented or not[1], you can specify the port via a CLI argument, like this:

react-native start --port 9988

I found it in the source code, and it worked on my local machine :)

[1] This is now documented here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download