react-native: React-Native IOS real device does not connect to Metro server

Description

My Simulator works fine it connects to the development server or metro. But on my ios real device is not connected .

Steps to reproduce

Connect ios real device with usb and same network.

React Native Version

0.73.4

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.3.1
  CPU: (8) arm64 Apple M1
  Memory: 71.36 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.17
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.3
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11330709
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: 0.73.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading connected app(s)...

Reproducer

https://github.com/ladybirdweb/faveo-support-app

Screenshots and Videos

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 25

Most upvoted comments

my app is installed in real device succesfully but not connected to metro bundler with xcode 16.2 and apple m4 chip, rn version 0.73.9 I already done lot of things from stack overflow , chatgpt, I connected my device hotspot to my system still it is not working also configure bundle in app also tried with same wifi in system and device HELP THANKS

System: OS: macOS 15.2 CPU: (8) arm64 Apple M2 Memory: 1.30 GB / 16.00 GB Shell: version: “5.9” path: /bin/zsh Binaries: Node: version: 23.5.0 path: /opt/homebrew/bin/node Yarn: Not Found npm: version: 10.9.2 path: /opt/homebrew/bin/npm Watchman: version: 2024.12.02.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.16.2 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 24.2 - iOS 18.2 - macOS 15.2 - tvOS 18.2 - visionOS 2.2 - watchOS 11.2 Android SDK: Not Found IDEs: Android Studio: 2024.2 AI-242.23339.11.2421.12700392 Xcode: version: 16.2/16C5032a path: /usr/bin/xcodebuild Languages: Java: version: 23.0.1 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: “@react-native-community/cli”: installed: 15.0.1 wanted: 15.0.1 react: installed: 18.3.1 wanted: 18.3.1 react-native: installed: 0.76.5 wanted: 0.76.5 react-native-macos: Not Found npmGlobalPackages: “react-native”: Not Found Android: hermesEnabled: true newArchEnabled: true iOS: hermesEnabled: true newArchEnabled: true WhatsApp Image 2025-01-07 at 10 38 34

what to do?

Shake your phone which has the app build installed, configure bundler- Give your Device IP (Laptop) address and Port : 8081 (port your running) and Reload

Please reopen this issue again I’m facing the same issue in “react-native”: “0.75.4”,

same issue, tried setting up a clean repo from scratch without expo. same thing happening. also, i can’t shake the device. no dev settings are appearing. localhost:8081/debugger-ui successfully opens on pc, on real device it doesn’t load. <PC_IP>:8081 successfully displays the bundle code on real device. localhost:8081 doesn’t. is this related to xcode configuration or something?

override func bundleURL() -> URL? {
#if DEBUG
    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
    Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }

isn’t the debug if check should correctly get the url that the bundle is running on?? when not connected also shaking doesn’t work. i’ve been struggling on this one for 3 days now. need some help.

metro version: Welcome to Metro v0.81.4

package.json:

{
  "name": "deleteThis",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "react": "19.0.0",
    "react-native": "0.78.1"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@react-native-community/cli": "15.0.1",
    "@react-native-community/cli-platform-android": "15.0.1",
    "@react-native-community/cli-platform-ios": "15.0.1",
    "@react-native/babel-preset": "0.78.1",
    "@react-native/eslint-config": "0.78.1",
    "@react-native/metro-config": "0.78.1",
    "@react-native/typescript-config": "0.78.1",
    "@types/jest": "^29.5.13",
    "@types/react": "^19.0.0",
    "@types/react-test-renderer": "^19.0.0",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "19.0.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

nodejs version: 18.18.2

IT’S NOT EVEN RETURNING NO BUNDLE URL PRESET ERROR. only at the first opening after a clean build. i’ve cleared the network settings of iphone still no help.

Shake your phone which has the app build installed, configure bundler- Give your Device IP (Laptop) address and Port : 8081 (port your running) and Reload

Thanks, this fixed my issue

+1

  • I have faced the same issue but on iOS 17.4 - react native 0.73.6. On Debug It worked when I refreshed the metro. But on release It is not running right now.
  • For iOS 16.6 It is ok!

On simulator it’s working in debug mode but when i connect real iOS device on debug mode that time metro is not connected any solution from your end.