Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Could not find iPhone X simulator #418

Closed
d3vhound opened this issue Jun 6, 2019 · 53 comments
Closed

error Could not find iPhone X simulator #418

d3vhound opened this issue Jun 6, 2019 · 53 comments
Labels
bug Something isn't working

Comments

@d3vhound
Copy link

d3vhound commented Jun 6, 2019

Environment

info
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 8.56 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.14.0 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.0, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.9 => 0.59.9
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      create-react-native-web-app: 0.1.11
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

Not related to
facebook/react-native#21824
facebook/react-native#23282
as they have older versions of react-native. 59.9 doesn't even have the files they mentions because this repo now handles it.

Since 59.9 and upgrading to xcode 10.2 react-native run-ios always produces an error. I've tried reinstalling simulators and even xcode itself many times now. I've also heard frojm many people that updgrading to xcode 10.2 produces this error as well.

Reproducible Demo

A good repro is completely uninstalling xcode then reinstalling it, start a new project, then you should get the error.

@d3vhound d3vhound added the bug Something isn't working label Jun 6, 2019
@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

I'm using Xcode 10.2.1 and never encountered this error. Can you post the full error you get (ideally with --verbose flag passed to the command)?

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

Also, make sure you have the latest CLI (so remove @react-native-community/cli from lockfile and run install again)

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

here's with --verbose

info Found Xcode workspace wellhaux.xcworkspace
error Could not find iPhone X simulator
debug Error: Could not find iPhone X simulator
    at runOnSimulator (/Users/devionvillegas/Developer/NEXTGEN/wellhaux/node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:131:11)
    at Object.runIOS [as func] (/Users/devionvillegas/Developer/NEXTGEN/wellhaux/node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:96:10)
    at Promise.resolve.then (/Users/devionvillegas/Developer/NEXTGEN/wellhaux/node_modules/@react-native-community/cli/build/cliEntry.js:152:22)
    at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
    at Function.Module.runMain (internal/modules/cjs/loader.js:880:11)
    at internal/main/run_main_module.js:21:11

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

Deleted my lock file and reran npm install. This is the top of the @react-native-community/cli/package.json

{
  "_from": "@react-native-community/cli@^1.2.1",
  "_id": "@react-native-community/cli@1.9.7",
  "_inBundle": false,
  "_integrity": "sha512-3Fw0TxB8fOVKD51kK9NN/SIonkvl8iCuUGb01RuzsrnMS76Wiu5JY3H7NhhPdvxFrrqa3vgBqJWRowAxbGJqJg==",
  "_location": "/@react-native-community/cli",
  "_phantomChildren": {

So which version do I have? 1.2.1 or 1.9.7?

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

You have 1.9.7 now which is good. Still happening?

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

Here's all the sims I have. I may be reaching but do you think it's something to do with 12.2 components not showing up in xcode?
Screen Shot 2019-06-06 at 3 26 15 AM

Even though they show up when running xcrun simctl list devices

== Devices ==
-- iOS 12.1 --
    iPhone 5s (1CC93BA4-8E94-4319-A1D9-B640CD9DA757) (Shutdown) 
    iPhone 6 (A6F49FCF-E818-4DF1-B342-CF778B350584) (Shutdown) 
    iPhone 6 Plus (8448D7B0-C18A-4767-A101-505ACD8B0D12) (Shutdown) 
    iPhone 6s (EF031039-A808-4957-881D-6E5560E06F12) (Shutdown) 
    iPhone 6s Plus (316CCAB2-C754-414F-A3E6-F59026B193DD) (Shutdown) 
    iPhone 7 (AFD06FEF-643F-4D12-B703-2043FEC8C724) (Shutdown) 
    iPhone 7 Plus (FBA408DC-8912-48FA-BC8C-9CDD96EDF813) (Shutdown) 
    iPhone 8 (65C3BA8E-2712-40AE-A929-30B5677E967E) (Shutdown) 
    iPhone 8 Plus (09E20267-4658-4ECD-95E0-DFA4F873E608) (Shutdown) 
    iPhone SE (A2208ECC-1893-4DCD-93E0-F5ACBF4DC394) (Shutdown) 
    iPhone X (714A5752-3D18-4364-AB26-D976EF9328CE) (Shutdown) 
    iPhone XS (566C5FA8-FF7E-4AC4-A693-803AE3E3BF2B) (Shutdown) 
    iPhone XS Max (29D705EB-50FE-4A7D-8269-8127D1B196A4) (Shutdown) 
    iPhone XR (E486671A-F5EF-4179-8DA9-FD65095D4EF6) (Booted) 
    iPad Air (A2C2AF2A-61A3-465A-A25D-ED78CF8C988F) (Shutdown) 
    iPad Air 2 (AB060328-7A20-4ACC-AE3F-A8C0DCFA0CF1) (Shutdown) 
    iPad Pro (9.7-inch) (E59F0220-5E11-4B43-AF86-20D14A1C95DA) (Shutdown) 
    iPad Pro (12.9-inch) (5DB9C1D0-538C-4B45-AF6A-C4F8ACA45D32) (Shutdown) 
    iPad (5th generation) (66D20187-289B-4772-A932-10247833EF97) (Shutdown) 
    iPad Pro (12.9-inch) (2nd generation) (1AFD9420-BCED-4736-9DCF-71F009ED178A) (Shutdown) 
    iPad Pro (10.5-inch) (513535FC-446A-4EE8-96C9-D92853E26D79) (Shutdown) 
    iPad (6th generation) (55656192-D08D-41E1-A54B-52AF0786E308) (Shutdown) 
    iPad Pro (11-inch) (3E07B737-20B2-491D-9F89-F337360E570C) (Shutdown) 
    iPad Pro (12.9-inch) (3rd generation) (D888A255-9B16-419B-B963-3756F401CA36) (Shutdown) 
-- iOS 12.2 --
    iPhone 5s (608EC1C2-6241-402F-BBCD-ADDFB00DE577) (Shutdown) 
    iPhone 6 (1E6C61F0-FDC5-4090-999A-55C4535B9306) (Shutdown) 
    iPhone 6 Plus (3F176C9C-BF95-4FB8-BD21-E667DB343ABB) (Shutdown) 
    iPhone 6s (44A134F9-BDA6-4376-B9C1-50F635D9754C) (Shutdown) 
    iPhone 6s Plus (A4F71D97-673D-4C0C-B32B-3AB2FF81F3F3) (Shutdown) 
    iPhone 7 (2603D812-6539-476C-840D-8E6F977BDE10) (Shutdown) 
    iPhone 7 Plus (95504A01-F1BF-4BC9-AD17-A05F52CCC20D) (Shutdown) 
    iPhone 8 (94E4C2BE-6B0D-4A82-A79B-58BCFE449A7A) (Shutdown) 
    iPhone 8 Plus (F4C88136-4D93-46C8-ABA5-E12A6E928A17) (Shutdown) 
    iPhone SE (EC021055-6DA2-4743-952A-5D0E1C8048FF) (Shutdown) 
    iPhone X (77DE19B9-A207-41F4-8111-8E0EB2CDE947) (Shutdown) 
    iPhone Xs (6C35D8F6-D2AB-4212-90B6-5957D0CD293B) (Shutdown) 
    iPhone Xs Max (73665255-E634-4846-8C52-F848E59668CE) (Shutdown) 
    iPhone Xʀ (FFD10F9C-F544-4FFF-8BC8-14F7ECD5A601) (Shutdown) 
    iPad Air (3CD87245-00C6-4182-A5F9-720D8BF6A436) (Shutdown) 
    iPad Air 2 (B905664B-5A40-40A7-8487-A6B01D743A8C) (Shutdown) 
    iPad Pro (9.7-inch) (5B3D24CB-6EFE-4052-ACBC-50B0B9DEF3DD) (Shutdown) 
    iPad Pro (12.9-inch) (90C57F20-176B-4E97-B0C0-DD98263CFEBF) (Shutdown) 
    iPad (5th generation) (8285A846-C5FF-4D24-94EF-5B2EFC74083C) (Shutdown) 
    iPad Pro (12.9-inch) (2nd generation) (5DBA22FD-E67B-47F1-81B6-EAB81F28693F) (Shutdown) 
    iPad Pro (10.5-inch) (42BF3F00-D6A3-4FB0-80DA-4F3109FD2D30) (Shutdown) 
    iPad (6th generation) (5A20DAD1-F01F-498D-9654-3C4937AFBE5B) (Shutdown) 
    iPad Pro (11-inch) (3234EE4C-32AF-42AF-B38F-78A26446BA4D) (Shutdown) 
    iPad Pro (12.9-inch) (3rd generation) (DB41BA31-ED34-4022-868B-5EBEE63D50E0) (Shutdown) 
    iPad Air (3rd generation) (725A430E-B88C-4755-B111-B2C61B081299) (Shutdown) 
-- tvOS 12.2 --
    Apple TV (11512701-F10B-49D9-BC49-B2F8217AEB98) (Shutdown) 
    Apple TV 4K (C95CD09F-4972-4DA9-B8E7-48441584DC0A) (Shutdown) 
    Apple TV 4K (at 1080p) (A012A3D6-AE0A-49F7-BFFF-1F2A1011FDFD) (Shutdown) 
-- watchOS 5.2 --
    Apple Watch Series 2 - 38mm (CA044B38-87F9-4085-8EC9-0A88A2BD8ABE) (Shutdown) 
    Apple Watch Series 2 - 42mm (99541A02-0751-4F3B-A737-827EAB781ABA) (Shutdown) 
    Apple Watch Series 3 - 38mm (9BB476AD-0691-4F5F-AF72-91CEABA387D5) (Shutdown) 
    Apple Watch Series 3 - 42mm (B435B58B-ACEA-4332-B837-4860B0E38E87) (Shutdown) 
    Apple Watch Series 4 - 40mm (9416812F-2A5C-4132-8CEB-5618F35CFC17) (Shutdown) 
    Apple Watch Series 4 - 44mm (E9D5DEB4-6F4B-49CC-BA06-DC136DADFBFB) (Shutdown) 

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

Yeah issue still exists. Also forgot to mention that building from Xcode works. That's why iPhone XR is booted in the cli output above. Just weird that the cli broke down on me. Another repro could be to download the new xcode beta. I regret doing it now but that could be the root cause

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

Another repro could be to download the new xcode beta. I regret doing it now but that could be the root cause

Oh, that's weird, because your envinfo shows Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild.

Then you may hit this: #414 (will make a release soon)

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

Yeah I've uninstalled the beta and wiped all the related xcode files before reinstalling 10.2. Just weird that the issue still exists when last week I had downloaded xcode 10.2 and everything was fine.

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

Can you try if applying that diff in your node_modules helps?

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

That pull request makes sense though and might be the solution. Do we know what causes it to persist in my case though? I do remember when I tried to delete xcode files following this forum post (https://forums.developer.apple.com/thread/110227) I couldn't and maybe the "issue" got persisted on to my machine

Couldn't delete these with sudo
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

You could probably delete them (if you're sure about that) in Safe Mode. Apple prevents deleting some of the files in regular mode

@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

That diff is the solution. Works now.

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

Thanks! I'll close the issue then

@thymikee thymikee closed this as completed Jun 6, 2019
@d3vhound
Copy link
Author

d3vhound commented Jun 6, 2019

Once I have more time I'll try and reproduce this whole issue with a mac VM. Pretty sure downloading the beta caused this.

@thymikee
Copy link
Member

thymikee commented Jun 6, 2019

Released 1.9.8 with the fix

@jasonivers
Copy link

I realize this is closed, but given the similarity of the error messages, it seemed appropriate to post this here, rather than as a new issue, though I can do that if it's preferable... I just encountered this error with xCode 10.3 and react-native-community 1.10.0. The "verbose" has changed slightly:

debug Error: Could not find iPhone X simulator
at runOnSimulator (./node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:131:11)
at Object.runIOS [as func] (./node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:96:10)
at Promise.resolve.then (./node_modules/@react-native-community/cli/build/cliEntry.js:152:22)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

@Pita
Copy link

Pita commented Jul 23, 2019

+1 this recocurring for me as well, probably caused by a recent apple update

@thymikee
Copy link
Member

Ah, Xcode breaking things all the time :D PRs welcome, as I'm not on Xcode 12.3 yet (and seeing folks having their simulators gone and not able to start, I'm not gonna do it yet)

@thymikee thymikee reopened this Jul 23, 2019
@Pita
Copy link

Pita commented Jul 23, 2019

Debugged a bit into this. I think the CLI does everything correctly, xcode is reporting the simulator as unavailable, see xcrun simctl list devices. But a simple reboot fixes it....

@thymikee Thanks for the quick response though!

@thymikee
Copy link
Member

@jasonivers have you tried what @Pita did?

@jasonivers
Copy link

A reboot does seem to have fixed it. I encountered the issue as I was trying to do one last build before signing off yesterday, or I probably would have rebooted myself. Either way, it appears a reboot is necessary, and then it is fixed.

@kaspot
Copy link

kaspot commented Jul 28, 2019

I have still the above described problem - also tried already to change all the proposed lines in node_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js Nothing seems to be working.

@nickcurran
Copy link

Rebooting did not solve this for me. Turns out that the Xcode Beta was set as the current command line version of code. Running

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

fixed it for me.

@thekevinbrown
Copy link

Tried @nickcurran's approach, didn't work. Rebooted, didn't work.

I installed XCode 11 beta 5, which is when the problem started.

@iampnelson
Copy link

I tried the above and nothing seemed to work. The following command worked for me.
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

@reactjsexample
Copy link

reactjsexample commented Sep 11, 2019

error Could not find "iPhone X" simulator. Run CLI with --verbose flag for more details.

Problem

There is no iPhone X!

Run Simulator by itself, in the top menu, look under Hardware, Device, iOS 13.0.

You will see there is:

  • iPhone 8
  • iPhone 8 Plus
  • iPhone XS
  • iPhone XS Max
  • iPhone XR
  • ... and some iPads

When you execute run-ios, react-native is designed to match a requested device.

The internally hard coded default is iPhone X.

The function that tries to match the requested device is in:

/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js

This function is designed so you can give it a device, and an optional version number.

If the given device and version cannot be found, it will return a match using the first device in the list by default.

But... in reality, the first device is a watch, and any watch is excluded from matching, so this function will return null.

Solution

Run Simulator first by itself, as described above, and make a note of which iPhone or iPad you want.

Then pass this name as an optional argument the the run-ios command line command as follows:

react-native run-ios --simulator="iPhone 8"

Also answered here:
react-native run-ios returns Error: Could not find iPhone X simulator

@rsalunga29
Copy link

When I run xcrun simctl list devices my terminal shows Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-12-4.

Apparently, iPhone X is not available on the iOS 13.0 simulators

@carloshuerta
Copy link

Apparently iPhone X is not available on the iOS 13.0 simulators, but you can easily add it by going to xcode and add it manually, once you add it there, run the "react-native run-ios" command again and it works.

@rahulbhankar786
Copy link

@carloshuerta
I added iPhone X manually in Xcode
but still it is not working.

@evrimfeyyaz
Copy link

Adding an iPhone X simulator through the command-line solved the issue for me, as I couldn't find an iPhone X simulator to install in the GUI on Xcode 11. Here is the command-line code:

/Applications/Xcode.app/Contents/Developer/usr/bin/simctl create "iPhone X" com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-0

@programmer-yang
Copy link

react-native : 0.57.8

update code:

  if (
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') &&
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')
    ) {
      continue;
    }

change the virtual machine version to iphone8
have tried
it still doesn't work

@ken0x0a
Copy link

ken0x0a commented Sep 24, 2019

react-native version "<60.0.0" which resolve "@react-native-community/cli" => "^1.0.0" is not compatible to Xcode 11.

Xcode simulator list format is not compatible to "@react-native-community/cli@^1.0.0"

1 solution is using "resolutions" in package.json,

  "resolutions": {
    "@react-native-community/cli": "^2.8.3"
  },

Or, patch every time for
./node_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js
using "postinstall" or something else.

@tunshiyu
Copy link

i update my package.json
"react": "16.8.6",
"react-native": "^0.59.4",

it woks,but there is new isue . you can have a try. 😿

@methuz
Copy link

methuz commented Sep 24, 2019

I solved by upgrading to react-native 0.60

@mwmcode
Copy link

mwmcode commented Sep 25, 2019

@methuz react-native 0.61 was released earlier today so it's downgrading if you're starting today with .60

@ilkinnamazov
Copy link

Hi All,

I found other solution without changing any source code in node_modules directory.

  1. Create react-native project folder (command: react-native init projectName)
  2. Open file projectName/ios/projectName.xcworkspace file in Xcode 11
  3. Choose device that you want to use (iPhone X not in list anymore after releasing iPhone Pro, so you need click on plus button and add to current list of devices)
  4. When your new device in list you can close Xcode 11 and try to run emulator from Terminal (react-native run-ios)

if you need any screenshots how to do that just let me know.

This is my first comment in github by the way so congrats me :)

Thank you.

@randomor
Copy link

randomor commented Oct 7, 2019

With 0.61 and Xcode 11, my fix is just adding a script in package.json in the scripts object:

"ios": "react-native run-ios --simulator 'iPhone 11 Pro'",

So you can run npm run ios.

But the real solution is to stop hardcoding in React Native Cli and always use whatever was the last used simulator from Xcode.

@thinklinux
Copy link

@ilkinnamazov epic first comment! Congrats!

@gsaandy
Copy link

gsaandy commented Oct 9, 2019

quick hack without upgrading react native
change the file node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js as below

image

@programmer-yang
Copy link

react-native : 0.57.8
i solved the problem

  1. change the file node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 42 line as below
    if (
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') &&
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')
    ) {
      continue;
    }
  1. change the file node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 56 line as below
      if (!simulator.isAvailable) {
        continue;
      }

@jeffcousins
Copy link

jeffcousins commented Oct 12, 2019

This fixed the error for me.

  • Open Xcode.
  • Select Window > Devices and Simulators from the top menu bar.
  • In the Devices and Simulators window, select the Simulators tab.
  • Add the iPhone X (and any others) in the left sidebar.
  • Don't give it a custom name since RN is looking for iPhone X.
  • Click Create.

@agurtovoy
Copy link

agurtovoy commented Oct 27, 2019

Expanding on @programmer-yang's workaround, react-native cli relies on the output of xcrun simctl list --json devices to find the matching device, and starting from Xcode 11 that output changed from

      {
        "state" : "Shutdown",
        "isAvailable" : "YES",
        "name" : "iPhone X",
        ...
      }

to

      {
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone X",
        ...
      }

See 2f24a8c for the corresponding fix in this repo.

Depending on your react-native version, you might also need to apply 08fd511 and add "iPhone X" to the list of known simulators as per @jeffcousins' comment above.

@Monte9
Copy link
Member

Monte9 commented Nov 3, 2019

@thymikee your simple solution worked for me! Thanks 💯

so remove @react-native-community/cli from lockfile and run install again

@nandorojo
Copy link

error Could not find "iPhone X" simulator. Run CLI with --verbose flag for more details.

Problem

There is no iPhone X!

Run Simulator by itself, in the top menu, look under Hardware, Device, iOS 13.0.

You will see there is:

  • iPhone 8
  • iPhone 8 Plus
  • iPhone XS
  • iPhone XS Max
  • iPhone XR
  • ... and some iPads

When you execute run-ios, react-native is designed to match a requested device.

The internally hard coded default is iPhone X.

The function that tries to match the requested device is in:

/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js

This function is designed so you can give it a device, and an optional version number.

If the given device and version cannot be found, it will return a match using the first device in the list by default.

But... in reality, the first device is a watch, and any watch is excluded from matching, so this function will return null.

Solution

Run Simulator first by itself, as described above, and make a note of which iPhone or iPad you want.

Then pass this name as an optional argument the the run-ios command line command as follows:

react-native run-ios --simulator="iPhone 8"

Also answered here:
react-native run-ios returns Error: Could not find iPhone X simulator

Yes! This worked with a bare expo project. Thank you!

@mobigaurav
Copy link

mobigaurav commented Nov 18, 2019

You can add a simulator in Xcode->Window>Device & Simulator. Go to the simulator tab and add a simulator. Once done, on command prompt run > react-native run-ios --simulator "your added simulator name"

@thymikee
Copy link
Member

Please update the @react-native-community/cli to the latest version, it's fixed there.

@SirCameron
Copy link

I have RN-cli vesion 2.0.1 and I am still getting this error.

@thymikee
Copy link
Member

@SirCameron react-native-cli is legacy global module and is not @react-native-community/cli. Please remove it, as it often conflicts with the locally installed CLI.

@SirCameron
Copy link

SirCameron commented Nov 18, 2019

@thymikee so should I install @react-native-community/cli with npm or simply use npx?
when I tried npx react-native run-ios I get the same error about the simulator.

i've removed react-native-cli globally and from the project.

@thymikee
Copy link
Member

Please follow the instructions on the page I linked in my comment :)

@SirCameron
Copy link

SirCameron commented Nov 18, 2019

@thymikee I did.

@react-native-community/cli@1.9.4

is the output. It is an older project using RN 0.59.8.

@thymikee
Copy link
Member

thymikee commented Nov 18, 2019

I think you didn't. Here's the latest version: https://www.npmjs.com/package/@react-native-community/cli/v/1.12.0. If you have troubles editing the lock file, remove it and install dependencies again.

@react-native-community react-native-community locked as resolved and limited conversation to collaborators Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests