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"
.