react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Not able to run ios app in ios simulator

Open chaudhary opened this issue 2 years ago • 4 comments

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

  1. create a new app using npx react-native init MyApp
  2. cd MyApp
  3. npx react-native run-ios

Snack, code example, screenshot, or link to a repository

Screenshot 2023-03-07 at 3 52 01 PM

chaudhary avatar Mar 07 '23 10:03 chaudhary

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.

iBotPeaches avatar Mar 07 '23 19:03 iBotPeaches

Why does it find my Macbook Pro as booted device ? It should look for a simulator and start one if not found

chaudhary avatar Mar 08 '23 13:03 chaudhary

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.

iBotPeaches avatar Mar 08 '23 13:03 iBotPeaches

How can I disable that behaviour ? I don't want to run my application on Mac

chaudhary avatar Mar 08 '23 18:03 chaudhary

Update to 0.71.4 - this should be fixed.

Gnative avatar Mar 09 '23 19:03 Gnative

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}

amnpoosri avatar Mar 10 '23 06:03 amnpoosri

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

roryf avatar Mar 10 '23 21:03 roryf

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.

github-actions[bot] avatar Sep 07 '23 05:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Sep 14 '23 05:09 github-actions[bot]