1

I am trying to build my app for React Native iOS, but the packager can't run since React Native only listens to port 8081 and port 8081 is taken by McAfee which can't be removed. How can I run React Native without using the packager?

Any help is appreciated!

  • Possible duplicate of [react native - Port 8081 already in use, packager is either not running or not running correctly Command /bin/sh failed with exit code 2](https://stackoverflow.com/questions/30216417/react-native-port-8081-already-in-use-packager-is-either-not-running-or-not-r) – Michael Cheng Jul 19 '17 at 17:25
  • The duplicate may also be a bit out of date so if it doesn't work, check out the comments in the issue tracker that are about this exact issue (McAfee taking the port). See [this](https://github.com/facebook/react-native/issues/10715) and [this](https://github.com/facebook/react-native/issues/14293) and [this](https://github.com/facebook/react-native/issues/9145). The issue is still ongoing, but the fix is generally the same as in that SO answer. You just may need to edit a few other files / change the start command. – Michael Cheng Jul 19 '17 at 17:28

2 Answers2

0

Hey try using another port.

npx react-native run-ios --port 8088
npx react-native start --port=8088
  1. "run-ios --port" is running IOS with the following port 8088
  2. "start --port" is running metro in the port 8088.

Aditional

After start you can open the app and follow those steps https://stackoverflow.com/a/71767276/5963210

-1

Try the release scheme. I think it works without using a packager.

https://facebook.github.io/react-native/docs/running-on-device.html#2-configure-release-scheme

Ahmet Şimşek
  • 1,391
  • 1
  • 14
  • 24
  • When I use the release scheme and click Product -> Build, I end with an error: Connection to localhost port 8081 [tcp/sunproxyadmin] succeeded! Port 8081 already in use, packager is either not running or not running correctly Command /bin/sh failed with exit code 2 – AdeptLearner Jul 19 '17 at 17:29