146

whenever I run react-native run-ios, I get

Could not find iPhone X simulator

Error: Could not find iPhone X simulator
    at resolve (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
    at new Promise (<anonymous>)
    at runOnSimulator (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
    at Object.runIOS [as func] (calendarPractice/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
    at Promise.resolve.then (calendarPractice/node_modules/react-native/local-cli/cliEntry.js:117:22)

however, when I run on Xcode, it works fine

{
  "devicetypes" : [
    {
      "name" : "iPhone 4s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 4s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
    },
    {
      "name" : "iPhone 5",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 5.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5"
    },
    {
      "name" : "iPhone 5s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 5s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5s"
    },
    {
      "name" : "iPhone 6",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6"
    },
    {
      "name" : "iPhone 6 Plus",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6 Plus.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus"
    },
    {
      "name" : "iPhone 6s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s"
    },
    {
      "name" : "iPhone 6s Plus",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6s Plus.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus"
    },
    {
      "name" : "iPhone 7",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 7.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7"
    },
    {
      "name" : "iPhone 7 Plus",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 7 Plus.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus"
    },
    {
      "name" : "iPhone 8",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 8.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8"
    },
    {
      "name" : "iPhone 8 Plus",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 8 Plus.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus"
    },
    {
      "name" : "iPhone SE",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone SE.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    {
      "name" : "iPhone X",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone X.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-X"
    },
    {
      "name" : "iPhone Xs",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone Xs.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XS"
    },
    {
      "name" : "iPhone Xs Max",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone Xs Max.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max"
    },
    {
      "name" : "iPhone Xʀ",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone Xʀ.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XR"
    },
    {
      "name" : "iPad 2",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad 2.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-2"
    },
    {
      "name" : "iPad Retina",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Retina.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Retina"
    },
    {
      "name" : "iPad Air",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Air.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air"
    },
    {
      "name" : "iPad Air 2",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Air 2.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air-2"
    },
    {
      "name" : "iPad (5th generation)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad (5th generation).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-"
    },
    {
      "name" : "iPad Pro (9.7-inch)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (9.7-inch).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-"
    },
    {
      "name" : "iPad Pro (12.9-inch)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro"
    },
    {
      "name" : "iPad Pro (12.9-inch) (2nd generation)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch) (2nd generation).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-"
    },
    {
      "name" : "iPad Pro (10.5-inch)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (10.5-inch).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-"
    },
    {
      "name" : "iPad (6th generation)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad (6th generation).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation-"
    },
    {
      "name" : "iPad Pro (11-inch)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (11-inch).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch-"
    },
    {
      "name" : "iPad Pro (12.9-inch) (3rd generation)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch) (3rd generation).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation-"
    },
    {
      "name" : "Apple TV",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple TV.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p"
    },
    {
      "name" : "Apple TV 4K",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple TV 4K.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K"
    },
    {
      "name" : "Apple TV 4K (at 1080p)",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple TV 4K (at 1080p).simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p"
    },
    {
      "name" : "Apple Watch - 38mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch - 38mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm"
    },
    {
      "name" : "Apple Watch - 42mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch - 42mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm"
    },
    {
      "name" : "Apple Watch Series 2 - 38mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 2 - 38mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm"
    },
    {
      "name" : "Apple Watch Series 2 - 42mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 2 - 42mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm"
    },
    {
      "name" : "Apple Watch Series 3 - 38mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 3 - 38mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm"
    },
    {
      "name" : "Apple Watch Series 3 - 42mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 3 - 42mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm"
    },
    {
      "name" : "Apple Watch Series 4 - 40mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 4 - 40mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm"
    },
    {
      "name" : "Apple Watch Series 4 - 44mm",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 4 - 44mm.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm"
    }
  ],
  "runtimes" : [
    {
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime",
      "availabilityError" : "",
      "buildversion" : "16B91",
      "availability" : "(available)",
      "isAvailable" : true,
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-1",
      "version" : "12.1",
      "name" : "iOS 12.1"
    },
    {
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/AppleTVOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/Runtimes\/tvOS.simruntime",
      "availabilityError" : "",
      "buildversion" : "16J602",
      "availability" : "(available)",
      "isAvailable" : true,
      "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-12-1",
      "version" : "12.1",
      "name" : "tvOS 12.1"
    },
    {
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/Runtimes\/watchOS.simruntime",
      "availabilityError" : "",
      "buildversion" : "16R591",
      "availability" : "(available)",
      "isAvailable" : true,
      "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-5-1",
      "version" : "5.1",
      "name" : "watchOS 5.1"
    }
  ],
  "devices" : {
    "com.apple.CoreSimulator.SimRuntime.watchOS-5-1" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 2 - 38mm",
        "udid" : "01AFDEF7-63B6-465C-A02A-44EE4A07EABA",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 2 - 42mm",
        "udid" : "BE62C985-DEE2-46EC-8962-A582D537EEE0",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 3 - 38mm",
        "udid" : "078BF157-30FA-41D1-94FA-6B1686E03085",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 3 - 42mm",
        "udid" : "E4CE652E-0185-4C59-B965-BED5FCEE7C76",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 4 - 40mm",
        "udid" : "6621323A-A9DE-4BCB-AC97-54C8C33B0158",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 4 - 44mm",
        "udid" : "D89037A3-66A0-43C1-90BA-E7C76CA0D724",
        "availabilityError" : ""
      }
    ],
    "com.apple.CoreSimulator.SimRuntime.tvOS-12-1" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV",
        "udid" : "AFAA21B8-BD4A-45EA-B0FF-E9915FE9B926",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV 4K",
        "udid" : "EBB88F2E-CFFE-4981-A736-7A7C0B85643D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV 4K (at 1080p)",
        "udid" : "F0B73E8A-986E-447E-B37A-2F46096DEFF6",
        "availabilityError" : ""
      }
    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-12-1" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 5s",
        "udid" : "F870B7FA-6DDA-4336-89AD-68A402844188",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 5s",
        "udid" : "6627ADE5-F8C1-4AE5-BD6F-3AEDDC0B7B63",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6",
        "udid" : "05574997-ACAD-40CA-A3D7-5624D53F00FA",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6 Plus",
        "udid" : "93237078-CA6D-4F97-93F9-779809700018",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s",
        "udid" : "9B50FE18-4F49-4EA4-80F0-DF498A667D33",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s Plus",
        "udid" : "D4640B6D-97DC-4CA1-BE63-C5403159A3D4",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7",
        "udid" : "6E9EEC00-3291-42B4-B04A-BA3487F9CD5F",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7 Plus",
        "udid" : "6DA1C3CF-1D1F-4DEF-9B74-2C40D5FB5881",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8",
        "udid" : "E19386B9-469A-450B-9CD2-B4FE8687DCF9",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8 Plus",
        "udid" : "6D36DF76-8ED9-41A2-9E1A-0BA48B92C26E",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone SE",
        "udid" : "EE4818DF-F817-4441-8A1C-BE1B99303E10",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone X",
        "udid" : "85B78A8F-C32B-4493-BDD1-65ECA3F77C86",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone X",
        "udid" : "CA12C337-4F66-4C6C-ACE5-7F7EACCBC39A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone XS",
        "udid" : "8BBCE315-2F4C-4132-8E53-28AF52401C8E",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone XS Max",
        "udid" : "4E77C62F-AB1F-4EDE-839B-53F70CAFC79E",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone XR",
        "udid" : "28D12ABE-3355-4862-960A-0FE5FFE41C7B",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air",
        "udid" : "94485C88-BCEB-456A-95DC-5F8C3DA8D181",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air 2",
        "udid" : "CF2C787D-A378-4AB9-B334-F7B24E94AF4D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (5th generation)",
        "udid" : "DFE602A5-EC68-4585-8AB0-C045A9843D29",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (9.7-inch)",
        "udid" : "5A3F3EAC-F788-49F1-A753-5D34A9990F0B",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch)",
        "udid" : "EF6EBE34-0A85-4FF0-8A45-7BA418A0CC0C",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (2nd generation)",
        "udid" : "FBA940F8-FD85-4D5E-A570-EB4F3A56E1F9",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (10.5-inch)",
        "udid" : "8AE4AAED-ECE0-4984-9679-8D3022064692",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (6th generation)",
        "udid" : "1121363D-EF49-4AC0-9E46-5C30318A24A2",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (11-inch)",
        "udid" : "038FECC0-8711-46E3-B601-8F88F2F4AD7D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (3rd generation)",
        "udid" : "12DC911F-2F45-4767-BC1A-6F1D0C8D9F3D",
        "availabilityError" : ""
      }
    ]
  },
  "pairs" : {
    "C9B69F4A-6A9D-44F3-A6BC-56BFA2F8B83F" : {
      "watch" : {
        "name" : "Apple Watch Series 4 - 44mm",
        "udid" : "D89037A3-66A0-43C1-90BA-E7C76CA0D724",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone XS Max",
        "udid" : "4E77C62F-AB1F-4EDE-839B-53F70CAFC79E",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    },
    "5327B65F-29E7-42D0-9861-FF31428F3218" : {
      "watch" : {
        "name" : "Apple Watch Series 4 - 40mm",
        "udid" : "6621323A-A9DE-4BCB-AC97-54C8C33B0158",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone XS",
        "udid" : "8BBCE315-2F4C-4132-8E53-28AF52401C8E",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    }
  }
Gianfranco P.
  • 10,049
  • 6
  • 51
  • 68
Seongmin Choo
  • 1,653
  • 3
  • 10
  • 14

26 Answers26

118

To fix this error, simply reinstall project & node modules using npm

npm install

Then it will show a list of warnings, and to fix them use the following command:

npm audit fix

This should fix everything, and allow you to run iOS emulator react-native run-ios

Weisheng Wu
  • 1,381
  • 2
  • 8
  • 10
109

Edited: I copied your devices section of your output JSON and embedded to my own /node_modules/react-native/local-cli/runIOS/runIOS.js

function runOnSimulator(xcodeProject, args, scheme) {
return new Promise(resolve => {
    try {
        var simulators = {devices section of your json}; //Here
    } catch (e) {
        console.log("e", e);
        throw new Error('Could not parse the simulator list output');
    }

    const selectedSimulator = findMatchingSimulator(simulators, args.simulator);
    console.log("selected", selectedSimulator);
    if (!selectedSimulator) {
        throw new Error(`Could not find ${args.simulator} simulator`);
    }
    ...

And finally, it gave the same error as yours. So I figured out that parsing version of devices different. In your devices, version is;

"com.apple.CoreSimulator.SimRuntime.tvOS-12-1" //for tvOS
"com.apple.CoreSimulator.SimRuntime.iOS-12-1" // for iOS

but in react-native checks this version values like this(/node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js);

// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
    continue;
}

So react-native can not recognize.
If we change this code with this;

// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')) {
    continue;
}

the problem was solved. I checked that with your JSON data in my computer and it worked.

sdkcy
  • 3,528
  • 1
  • 16
  • 23
  • 24
    Hate that this worked - anyone have a more permanent solution? – Kevin Grant Mar 26 '19 at 20:47
  • Same problem here. Is there any permanent solution to avoid nom install backroll. Downgrade to xcode 10.0? – Patrik Rikama-Hinnenberg Mar 27 '19 at 16:54
  • 2
    In case anyone was running iPhone XR specifically (ie. `react-native run-ios --simulator='iPhone XR'`), use the following, `react-native run-ios --simulator='iPhone Xʀ'`. Using a lowercase r will not work. – Mix Master Mike Apr 02 '19 at 02:17
  • 4
    The longer term fix is to await the next release of `react-native-cli`, where this is fixed https://github.com/react-native-community/react-native-cli/pull/274 – wbharding Apr 03 '19 at 19:19
  • Permanent solution for this issue? For me it works to upgrade RN to 0.58.6 – Augusto Gonzalez May 17 '19 at 22:56
  • 4
    How is this the answer?!?!?!?! you don't mess with plugins like that – arled Jun 04 '19 at 10:12
  • 2
    This doesn't work anymore. runIOS folder isn't on react-native folder in node_modules as of today. Any other fix? – Akio Sep 21 '19 at 04:01
  • @MixMasterMike i run your command but in every time just iPhone x launch :( – Oliver D Feb 10 '20 at 08:26
  • @MixMasterMike you can run any installed simulator with that command `react-native run-ios --simulator="iPhone SE"`. For example that command will run iPhone SE simulator, which is installed on Xcode. – sdkcy Feb 10 '20 at 12:07
  • @OliverD unfortunately, I haven't touched my RN project since posting my comment. But did you happen to copy and paste the 2nd code? The one with the small capital R. – Mix Master Mike Feb 11 '20 at 17:58
  • @sdkcy yup, that's the idea. the key is to know the exact model you're trying to target as stated [here](https://facebook.github.io/react-native/docs/running-on-simulator-ios). – Mix Master Mike Feb 11 '20 at 18:04
78

PROBLEM

If you try this with the latest Xcode (11), 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 1 - Use an existing Xcode device

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"

SOLUTION 2 - Add New Xcode iOS Device

According to Xcode 11 Release Notes:

"Xcode no longer creates every available iOS simulator device by default. Instead a set of the most commonly used devices are created. To create other devices — or multiple instances of a device — open the Devices window, select Simulators, click the + button, enter a name, and select the relevant device type and OS version. In Terminal, execute the xcrun simctl create command, for example xcrun simctl create "My iPhone 7" "iPhone 7" iOS13.0. (49428617)"

In Xcode, you need to add a new device called "iPhone X".

Also I answered here: React Native Issue #2328

JC Lango
  • 1,076
  • 6
  • 6
  • 1
    Thanks a lot, you saved the day. Instead of manually configuring the changes this is the easiest and by far the most accurate solution in case of ios 13+. Personally this should be tagged as the accepted answer. – Parth Manaktala Sep 15 '19 at 18:12
  • 6
    this should be the accepted answer, along with a quick explanation of how to change the RN default from iPhone X – nosequeldeebee Sep 21 '19 at 16:29
  • 1
    iOS 13.0 simulators now doesn't include every available devices except for the most used one, you need to manually create them if you want other devices (e.g iPhone 7, iPhone X). Reference is here: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes – Akio Sep 22 '19 at 09:10
  • this fixed and should be the primary answer. – Jay Sep 24 '19 at 15:31
  • I simply added an iPhone X to the list of available devices directly in XCode. Now it can be found! – bergjs Sep 25 '19 at 20:23
  • Yes, this is the actual reason, do not try to edit any files. Thanks a lot. – Kampai Oct 10 '19 at 09:07
  • Radu Cimpian's answer tells you how to do SOLUTION #2. – kojow7 Jan 10 '20 at 02:33
48

Temporary fix:

Step 1: Open the file /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

Step 2: Change a line of code, from this:

if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
  continue;
}

to this:

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

Step 3: Run react-native run-ios (you might need to run it twice, and don't forget to kill the Metro Bundler [the console that's running in the background] if it's running from your previous unsuccessful build!)

The problem was that after an update to Xcode - the simulator namespaces were added to the devices' versions list. The React Native build wasn't expecting these namespaces - hence the build break.

orberkov
  • 1,145
  • 2
  • 13
  • 27
37

after update to Xcode 11 xcrun returns true or false and not YES or NO as before.

goto /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js and in

find

if (
   simulator.availability !== '(available)' &&
   simulator.isAvailable !== 'YES'
 ) {
  continue;
}

and change it to

if (
   simulator.availability !== '(available)' &&
   simulator.isAvailable !== true
 ) {
  continue;
}
David Chelidze
  • 1,143
  • 12
  • 19
  • 3
    This worked for me as well. Found it different directory. node_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js – user781404 Jun 11 '19 at 20:42
  • 1
    They changed it again (wtf) ```/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js``` – Oliver Dixon Jul 25 '19 at 08:22
  • I couldn't find (wtf) – Forhad Oct 05 '19 at 08:21
  • too bad. Same thing here. In earlier versions of XCode, I had to change the `version.startsWith` to `version.includes`, which has been fixed. Now, a couple of lines further down, change 'YES' to true… A never ending story – cokron Nov 18 '19 at 10:17
  • had to change it in the community package, worked, thanks – matt93 Dec 16 '19 at 12:34
34

There is no iPhone X simulator on your machine, most probably because you updated Xcode. You can simply pass the name of the available simulator like below:

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

For checking available simulators you can open Xcode and check on device list as shown below:

enter image description here

Vikas
  • 914
  • 7
  • 19
10

Open the file /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

!version.startsWith('iOS') - > !version.includes('iOS')

Melih Sevim
  • 930
  • 6
  • 9
9

I also did not have iPhone X installed as a simulator on Xcode. All I had to do was add the iPhone X as a new simulator in Xcode and all is well.

In Xcode: Go to Window then Devices and Simulators. Click the simulators tab. Click the + button on the bottom left corner and add the iPhone X.

I hope this fix is as easy for you as it was for me.

alxlives
  • 5,084
  • 4
  • 28
  • 50
Rose
  • 91
  • 1
  • 3
9

After I updated Xcode to version 11, I encountered the same problem.

A solution can be to add the iPhone X simulator into your list.

  • Choose simulator -> Hardware -> Manage Devices (you will see a popup)

  • Choose "Simulators" -> (left bottom corner) +(the plus icon, next to "Filter") then add a new simulator,

  • Simulator Name: iPhone X Device Type: Choose iPhone X.

It worked for me

Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49
Radu Cimpian
  • 91
  • 1
  • 3
  • 1
    This is the proper 2019 solution – sospedra Oct 30 '19 at 09:54
  • Definitely the way to go. Ran into 2 small issues tho: 1- Had to pair my new "iPhone X" simulator with an iOS 12.4 runtime 2- Had to replace `simulator.isAvailable !== 'YES'` with `simulator.isAvailable !== true` in `node_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js` – eightyfive Nov 01 '19 at 05:58
7

I encountered the same error when i upgraded my Xcode 10 to Xcode 11, But specifying the simulator version happens to be a quick fix for me.

First list all available ios emulator with

  xcrun simctl list devices | grep iPhone | grep -v unavailable | cut -d'(' -f1

Result Output

Then select one to run react-native with, e.g

 react-native run-ios --simulator='iPhone 11 Pro Max'
Ajeett
  • 814
  • 2
  • 7
  • 18
samtax01
  • 834
  • 9
  • 11
6

For Xcode 11.2 and iOS 13.2 here are changes i've done to run the app in simulator

in findMatchingSimulator.js

line 43:

if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {

to

if (!version.includes('iOS') && !version.includes('tvOS')) {

line

line 52

if (
    simulator.availability !== '(available)' &&
    simulator.isAvailable !== 'YES'
  ) {
    continue;
  }

to

if (
    simulator.isAvailable != true
  ) {
    continue;
  }

P.S.

First day on React project ad already lowing it! (no)

Andrew
  • 573
  • 2
  • 6
  • 18
5

in my case i run the script: sed -i '' 's/startsWith/includes/g' node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js and it worked. also suitable for people who can't update react-native

Omar Soufiane
  • 183
  • 2
  • 3
5

My problem was that iPhone X simulator was not installed

You can check what simulators are installed with

xcrun simctl list devices | grep iPhone | grep -v unavailable | cut -d'(' -f1

Then run

react-native run-ios --simulator="iPhone Xs"
ricardo
  • 1,221
  • 2
  • 21
  • 39
3

easy fix...

Xcode -> preferences -> components install ios 12.2 sumulator

velvetInk
  • 368
  • 1
  • 4
  • 18
2

if could not found simulator still persists after replacing following lines of code in runSimulator.js.

Path for runSimulator.js -> /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

if (!version.startsWith('iOS') && !version.startsWith('tvOS')) { continue; }

with this one

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

comment following lines after replacing

if ( simulator.availability !== '(available)' && simulator.isAvailable !== 'YES' ) { continue; }

It will launch iPhone simulator without any issue.

and 2nd approach after updating to XCode 11

Xcode 11 xcrun returns true or false and not YES or NO for isAvailable property as before. You can check that using the following command

xcrun simctl list devices --json 

above command will print all available devices like following

"com.apple.CoreSimulator.SimRuntime.iOS-12-2" : [
  {
    "state" : "Booted",
    "isAvailable" : true,
    "name" : "iPhone X",
    "udid" : "E53748D1-628B-4A99-A419-4D7AE7CE4745"
  }
]

Replace YES with true in following code

if ( simulator.availability !== '(available)' && simulator.isAvailable !== 'YES' ) { continue; }

like this

if ( simulator.availability !== '(available)' && simulator.isAvailable !== true ) { continue; }
kaushal
  • 903
  • 10
  • 17
  • Yes, that's what my issue was that after update to xcode 11 i started getting this error. replacing 'YES' with true did the job. – Sudhir Sep 30 '19 at 11:38
2

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

file

options: [{
    name: '--simulator [string]',
    description: 'Explicitly set simulator to use. Optionally include iOS version between' + 'parenthesis at the end to match an exact version: "iPhone 6 (10.0)"',
    default: 'iPhone X'
  }

to

options: [{
    name: '--simulator [string]',
    description: 'Explicitly set simulator to use. Optionally include iOS version between' + 'parenthesis at the end to match an exact version: "iPhone 6 (10.0)"',
    default: 'iPhone 8'
  }
Can Gülse
  • 91
  • 1
  • 3
2

I encountered this issue after trying to upgrade React Native from 0.59.8 to 0.59.9.

It turns out (based the above answers), we need to update @react-native-community/cli module:

  1. Remove it from lockfile (yarn.lock or package-lock.json)
  2. Run yarn or npm install to install it again.

reference: https://github.com/react-native-community/rn-diff-purge/issues/21#issuecomment-507645945

leftL
  • 158
  • 6
1

With react-native-cli 2.0.1, you may want to just rename your simulator. By default Xcode will name some devices in the format <DeviceName> (<DeviceSize>). However this version of the CLI interprets anything in parentheses as the iOS version.

When trying to run a simulator named iPad Pro (10.5-inch), I was able to get it to run by simply renaming the simulator to iPad Pro [10.5-inch].

You can rename simulators by using the Simulator app's Hardware->Device->Manage Devices... menu, and right-clicking one of your simulators (in Xcode 10.2.1)

Cruinh
  • 3,611
  • 4
  • 38
  • 45
1

I faced the issue when I updated Xcode. All the simulators were not available/uninstalled. I am installing them again.

rajeswari ratala
  • 650
  • 7
  • 14
1

In my case, i have tried others above solution but nothing worked.

Then i try upgrading react-native from 0.59.5 to 0.59.10 then it's solved

raosan
  • 11
  • 1
1

What fixed it for me was not having Xcode command lines tools set (xcrun simctl was failing.) If you just re-installed Xcode, you might have this issue.

See this post on how to set the command line tools. After, try running react-native run-ios --simulator="iPhone 11" (or whatever your simulator name is).

Shane Sepac
  • 806
  • 10
  • 20
1

In my case the problem was that after an xcode update the simulator got removed and I had to create it manually (as this new xcode Version did not had it as a default)

You could check if it is as device listed here:

xcrun simctl list devices

If it's under the "Unavailable" title (because you're missing the iOS version), you can create one with you current version, or download the expected runtime.

For that go to XCode->Window->Devices and Simulators and hit on the plus button, to create your simulator with model an iOS version as depicted here: Screenshot add Simulator

That solved my problem.

estani
  • 24,254
  • 2
  • 93
  • 76
0

For me, I had to update React Native to 0.60 by running npx react-native-git-upgrade.

Ryan Kane
  • 51
  • 6
0

I had the same problem

npm audit fix

this worked for me

Mr Abbasi
  • 97
  • 11
-1

I'm having the same issue each time I update Xcode.
I run this command:

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

Then I run react-native run-ios again.

Erik Rybalkin
  • 1,143
  • 12
  • 21
-4

Just reboot your computer and run command again.