How to run react-native packager on different port?

Problem 😱

You have some program running on react-native default port.


Solution πŸ€“

You will need to run packager with following port:

yarn start --port 8085

iOS πŸ“±

In your xcode open project_dir/ios/project.xcodeproj. Change following line Libraries/React.xcode.proj/React/Base RCTBundleURLProvider.m

const NSUInteger kRCTBundleURLProviderDefaultPort = 8085;

Android πŸ€–

On android emulator press cmd + m. Dev Settings -> Debug server host & port for device -> localhost:8085.

By @PythonicNinja in
Tags : #react-native, #ios, #android, #mobile,