Skip to content

Instantly share code, notes, and snippets.

@nkabrown
Last active September 18, 2017 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkabrown/88d47942f67b9fc834ffa94357107805 to your computer and use it in GitHub Desktop.
Save nkabrown/88d47942f67b9fc834ffa94357107805 to your computer and use it in GitHub Desktop.
McAfee port 8081 workaround for react-native ios simulator

In <Project>/node_modules/react-native/React/React.xcodeproj/project.pbxproj replace all occurances of 'port 8081' with '8088'. Redone every time you npm install or yarn add a dependency

Open project in xcode by File -> Open -> <Project>.xcodeproj. Then go to <Project>/AppDelegate.m and change jsCodeLocation to jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8088/index.ios.bundle?platform=ios&dev=true"];

Run packager on port 8088 react-native start --port 8088.

Then run react-native run-ios.

Remove annoying Connection has no connected handler warning. react-native log-ios | grep -v nw_connection_get_connected

Bundle will not be created on Android because of the new port packager is running on. Add this to "scripts" in package.json:

"build-android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment