Oza
Oza

Reputation: 157

react-native run-ios doesn't run the app, but building it from xcode works

I'm making a react-native app and have a problem. When I run the command: react-native run-ios, the build succeeds, and simulator starts, but the app won't start and my console does not build js bundle.

enter image description here

but when I build the sourc /ios/[projectName].xcodeproj from XCode, It works fine.

Can anyone help figure out why and how to fix this?

Upvotes: 4

Views: 4050

Answers (1)

Neil Cuthbert
Neil Cuthbert

Reputation: 305

In my case, making sure I didn't have any simulators with the same name helped.

I recently updated to Xcode 10.2 and have simulators for iOS 12.1 and 12.2 but they have the same name in Xcode > Window > Devices and Simulators.

UPDATE: You can specify the iOS version for the simulator react-native run-ios --simulator 'iPhone 6s (10.2)' and it will attempt to find the correct simulator if there are multiple found.

https://github.com/facebook/react-native/issues/19069#issuecomment-385545599


OR rename your simulators in xcode to whatever you want

iPhone X iOS 12.1 simulator

iPhone X iOS 12.2 simulator

Right click and rename one of them so the names are unique, then react-native run-ios started working.

Rename simulator

Updated simulator name

Environment: Xcode: 10.2.1 React Native: 0.59.9

Upvotes: 1

Related Questions