I’m trying to run a React Native app with Metro on a port other than the default 8081 (e.g. 10000).

I’ve followed the official React Native docs here:
https://reactnative.dev/docs/troubleshooting#using-a-port-other-than-8081

react native docs

From my project root, I start Metro like this:

yarn start --port 10000 

Metro starts up fine on port 10000.

However, when I run the iOS app in the simulator from Xcode, I get this error:

No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle. 

screenshot of app in simulator

According to the docs, for iOS I should:

update occurrences of 8081 to your chosen port in ios/__App_Name__.xcodeproj/project.pbxproj.

The problem is: in my ios/__App_Name__.xcodeproj/project.pbxproj file there are no occurrences of 8081 at all, so I have nothing to replace. Searching for 8081 returns nothing.


What I’ve tried

  • Starting Metro with yarn start --port 10000

  • Cleaning the build folder in Xcode and rebuilding the app

  • Restarting the iOS simulator

  • Searching the entire ios/ folder (including project.pbxproj) for 8081 → no matches found


Environment

  • React Native: (version here, e.g. 0.73.8)

  • Using the React Native CLI (not Expo)

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.