facebook/metro

Metro bundle not connecting to iOS simulator in Release and Debug mode

gkasireddy202 opened this issue · 6 comments

Do you want to request a feature or report a bug?

What is the current behavior?
My app is successfully built and runs on an iOS simulator using react-native:0.73.2 Unable to connect with a metro bundle in Release and debug mode. Metro bundle not showing when we run on the iOS simulator in release mode.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

What is the expected behavior?

Need to run on the metro bundle on iOS
Screenshot 2024-04-09 at 1 55 18 PM

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

System:
OS: macOS 14.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 189.00 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 19.8.1
path: /usr/local/bin/node
Yarn: Not Found
npm:
version: 6.14.18
path: ~/Documents/Projects/MyApps/Mobile/node_modules/.bin/npm
Watchman:
version: 2023.03.13.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.12.0
path: /Users/gopi/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- watchOS 10.2
Android SDK:
API Levels:
- "23"
- "24"
- "25"
- "26"
- "27"
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
Build Tools:
- 28.0.3
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 32.0.0
- 32.1.0
- 33.0.0
System Images:
- android-29 | Google APIs Intel x86 Atom
- android-29 | Google Play Intel x86 Atom
- android-30 | Google APIs Intel x86 Atom
- android-32 | Google APIs Intel x86 Atom_64
- android-32 | Google Play Intel x86 Atom_64
- android-33 | Google APIs Intel x86 Atom_64
- android-33 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode:
version: 15.1/15C65
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.15
path: /usr/bin/javac
Ruby:
version: 2.7.6
path: /Users/gopi/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.2
wanted: 0.73.2
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: false

I have exactly the same issue on my side. Using a Mac to build my app, before the update I was running the app with RN 0.71 and had any issues.
Since the upgrade, I'm facing the same error as @gkasireddy202.
It's a bit annoying to develop (if impossible to say so).

Does anyone face this issue before or have any idea on how to investigate on it ?

I have exactly the same issue on my side. Using a Mac to build my app, before the update I was running the app with RN 0.71 and had any issues. Since the upgrade, I'm facing the same error as @gkasireddy202. It's a bit annoying to develop (if impossible to say so).

Does anyone face this issue before or have any idea on how to investigate on it ?

Please use debug option in Xcode edit scheme

In the Xcode I only have that:
I don't have any Debug option.
Did it solved your issue ?

In the Xcode I only have that: Capture d’écran 2024-04-12 à 18 20 37 I don't have any Debug option. Did it solved your issue ?

Please select run option and you can see release and debug mode.

I've changed it under the run mode and have the following command while running the application:
info Building (using "xcodebuild -workspace parati_app.xcworkspace -configuration Debug -scheme parati_app -destination id=9264576C-765F-4092-8BD4-43464A214156")

And indeed I confirm, it works as expected ! Thank you @gkasireddy202

Eu alterei isso no modo de execução e tenho o seguinte comando ao executar o aplicativo: info Building (using "xcodebuild -workspace parati_app.xcworkspace -configuration Debug -scheme parati_app -destination id=9264576C-765F-4092-8BD4-43464A214156")

E de fato eu confirmo, funciona como esperado! Obrigado@gkasireddy202

Can you explain better?

Do you have more than one scheme? (PRD/DEBUG/HOMOL)?
I face the same problem, my application was updated from 0.66.5 to 0.75.3 and my application builds normally, but it doesn't connect to the metro bundle (dev)

xcode convert the "yarn ios:staging" ("npx pod-install && ENVFILE=.env.hml npx react-native run-ios --scheme='HML' --simulator='iPhone 15'")

to : info Building (using "xcodebuild -workspace XPTO.xcworkspace -configuration Homolog -scheme HML -destination id=414BAF8E-79C5-421E-A9E2-E4B02D858F45")

but after the complete build when I try to update the app, it is not connected to the bundle server...._info Reloading connected app(s)...

warn 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._