react-native
react-native copied to clipboard
Not able to run ios app in ios simulator
Description
If I run build through xcode, it works fine.
But running npx react-native run-ios. gives error
React Native Version
0.71.3
Output of npx react-native info
System: OS: macOS 13.2.1 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Memory: 137.56 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.7.0 - ~/.nvm/versions/node/v19.7.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v19.7.0/bin/yarn npm: 9.5.0 - ~/.nvm/versions/node/v19.7.0/bin/npm Watchman: 2023.03.06.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.0 - /Users/amitchaudhary/.rvm/gems/ruby-2.7.6/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.3 => 0.71.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- create a new app using
npx react-native init MyApp cd MyAppnpx react-native run-ios
Snack, code example, screenshot, or link to a repository
Based on that error you are pointing to a device that is not available as a destination. You can see the 95Exx device was specified, but the error does not list that as a valid destination.
Why does it find my Macbook Pro as booted device ? It should look for a simulator and start one if not found
Why does it find my Macbook Pro as booted device ? It should look for a simulator and start one if not found
You can run applications natively on a Mac as of recently. Chances are some of your native dependencies won't support it, but its possible.
How can I disable that behaviour ? I don't want to run my application on Mac
Update to 0.71.4 - this should be fixed.
The fix has been merged https://github.com/react-native-community/cli/pull/1823 but will probably release in the next version of react-native
Alternatively, you can run an iOS app by targeting simlator or use Xcode to run your project
xcrun xctrace list devices
react-native run-ios —udid={device_id}
Here is the fix above on the current cli version https://github.com/react-native-community/cli/pull/1863 once that's merged hopefully another 0.71 can be released
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.