`react-native run-ios` mengembalikan Kesalahan: Tidak dapat menemukan simulator iPhone X.


122

setiap kali saya lari react-native run-ios, saya mengerti

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)

Namun, ketika saya menjalankan Xcode, itu berfungsi dengan baik

{
  "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)"
    }
  }

apa versi xcode Anda?
sdkcy

versi xcode saya adalah 10.1
Seongmin Choo

versi react-native mana yang Anda gunakan? karena beberapa versi react-native memiliki masalah terkait masalah ini
sdkcy

Paket: bereaksi: 16.6.3 => 16.6.3 react-native: ^ 0.58.3 => 0.58.3
Seongmin Choo

Saya pikir ini adalah versi terbaru
Seongmin Choo

Jawaban:


108

Diedit: Saya menyalin bagian perangkat Anda dari JSON keluaran Anda dan menyematkannya ke milik saya /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`);
    }
    ...

Dan akhirnya, itu memberikan kesalahan yang sama seperti milik Anda. Jadi saya menemukan bahwa versi parsing perangkat berbeda. Di perangkat Anda, versinya adalah;

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

tetapi dalam react-native memeriksa nilai versi ini seperti ini ( /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;
}

Jadi react-native tidak bisa mengenali.
Jika kita mengubah kode ini dengan ini;

// 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;
}

masalah terselesaikan. Saya memeriksanya dengan data JSON Anda di komputer saya dan berhasil.


22
Benci ini berhasil - ada yang punya solusi yang lebih permanen?
Kevin Grant

2
Jika ada yang menjalankan iPhone XR secara khusus (mis. react-native run-ios --simulator='iPhone XR'), Gunakan yang berikut react-native run-ios --simulator='iPhone Xʀ',. Menggunakan huruf kecil r tidak akan berhasil.
Campur Master Mike

4
Perbaikan jangka panjang adalah menunggu rilis berikutnya react-native-cli, yang telah diperbaiki github.com/react-native-community/react-native-cli/pull/274
wbharding

4
Bagaimana ini jawabannya?!?!?!?! Anda tidak perlu mengacaukan plugin seperti itu
Led

2
Ini tidak berfungsi lagi. folder runIOS tidak ada di folder react-native di node_modules mulai hari ini. Ada perbaikan lain?
Akio

100

Untuk memperbaiki kesalahan ini, cukup instal ulang modul project & node menggunakan npm

npm install

Kemudian akan muncul daftar peringatan, dan untuk memperbaikinya gunakan perintah berikut:

npm audit fix

Ini harus memperbaiki semuanya, dan memungkinkan Anda menjalankan emulator iOS react-native run-ios


4
Ini tidak ada hubungannya dengan npm karena hanya akan menginstal atau mengaudit modul node
Firu

15
Ini memperbaikinya untuk saya ... tanpa melakukan jawaban yang diterima. Terima kasih!
RiddlerDev

1
@Firu Namun setidaknya ada tiga dari kita sekarang yang ini adalah perbaikannya.
Rob Osborne

2
ini tidak berhasil untuk saya. react-native --version-> react-native-cli: 2.0.1 react-native: 0.57.7 react-native info->macOS 10.14.4 Platforms: iOS 12.2 Xcode: 10.2/10E125
Gianfranco P.

3
imho ini harus menjadi jawaban yang benar. Mengubah node_modulesfile seharusnya bukan jawaban yang valid. Ini akan kembali menggigit Anda ketika Anda membuang node_modulesfolder karena alasan apa pun.
Bathan

62

MASALAH

Jika Anda mencoba ini dengan Xcode terbaru (11), tidak ada iPhone X!

Jalankan Simulator dengan sendirinya, di menu atas, lihat di bawah Perangkat Keras, Perangkat, iOS 13.0. Anda akan melihat ada:

  • iPhone 8
  • iPhone 8 Plus
  • iPhone XS
  • iPhone XS Max
  • iPhone XR
  • ... dan beberapa iPad

Saat Anda mengeksekusi run-ios, react-native dirancang agar sesuai dengan perangkat yang diminta.

Default kode keras internal adalah iPhone X.

Fungsi yang mencoba untuk mencocokkan perangkat yang diminta ada di:

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

Fungsi ini dirancang agar Anda dapat memberinya perangkat, dan nomor versi opsional.

Jika perangkat dan versi yang diberikan tidak dapat ditemukan, itu akan mengembalikan kecocokan menggunakan perangkat pertama dalam daftar secara default.

Tapi ... pada kenyataannya, perangkat pertama adalah jam tangan, dan jam tangan apa pun dikecualikan dari pencocokan, jadi fungsi ini akan mengembalikan null.

SOLUSI 1 - Gunakan perangkat Xcode yang ada

Jalankan Simulator dengan sendirinya, seperti dijelaskan di atas, dan catat iPhone atau iPad mana yang Anda inginkan.

Kemudian berikan nama ini sebagai argumen opsional perintah baris perintah run-ios sebagai berikut:

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

SOLUSI 2 - Tambahkan Perangkat iOS Xcode Baru

Menurut Catatan Rilis Xcode 11 :

"Xcode tidak lagi membuat setiap perangkat simulator iOS yang tersedia secara default. Sebaliknya satu set perangkat yang paling umum digunakan dibuat. Untuk membuat perangkat lain - atau beberapa contoh perangkat - buka jendela Perangkat, pilih Simulator, klik tombol +, masukkan nama, dan pilih jenis perangkat dan versi OS yang relevan. Di Terminal, jalankan perintah xcrun simctl create, misalnya xcrun simctl create "My iPhone 7" "iPhone 7" iOS13.0. (49428617) "

Di Xcode, Anda perlu menambahkan perangkat baru yang disebut "iPhone X".

Juga saya jawab di sini: React Native Issue # 2328


1
Terima kasih banyak, Anda menyelamatkan hari ini. Alih-alih mengonfigurasi perubahan secara manual, ini adalah solusi termudah dan sejauh ini paling akurat untuk ios 13+. Secara pribadi ini harus diberi tag sebagai jawaban yang diterima.
Parth Manaktala

5
ini harus menjadi jawaban yang diterima, bersama dengan penjelasan singkat tentang cara mengubah default RN dari iPhone X
nosequeldeebee

1
Simulator iOS 13.0 sekarang tidak menyertakan semua perangkat yang tersedia kecuali yang paling sering digunakan, Anda perlu membuatnya secara manual jika Anda menginginkan perangkat lain (mis. iPhone 7, iPhone X). Referensi ada di sini: developer.apple.com/documentation/xcode_release_notes/…
Akio

ini diperbaiki dan harus menjadi jawaban utama.
Jay

Saya hanya menambahkan iPhone X ke daftar perangkat yang tersedia langsung di Xcode. Sekarang bisa ditemukan!
bergjs

47

Perbaikan sementara:

Langkah 1 : Buka file/node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

Langkah 2 : Ubah baris kode, dari ini:

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

untuk ini:

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

Langkah 3 : Jalankan react-native run-ios(Anda mungkin perlu menjalankannya dua kali, dan jangan lupa untuk mematikan Metro Bundler [konsol yang berjalan di latar belakang] jika dijalankan dari versi sebelumnya yang gagal!)

Masalahnya adalah setelah pembaruan ke Xcode - ruang nama simulator ditambahkan ke daftar versi perangkat. Build React Native tidak mengharapkan namespace ini - oleh karena itu build break.


1
Saya tidak dapat menemukan direktori runIOS. Ada saran?
Naman Jain

31

setelah update ke Xcode 11 xcrun mengembalikan true atau false dan tidak YES atau NO seperti sebelumnya.

goto /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js dan di

Temukan

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

dan mengubahnya menjadi

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

3
Ini juga berhasil untuk saya. Menemukannya direktori yang berbeda. node_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js
user781404

1
Mereka mengubahnya lagi (wtf)/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/findMatchingSimulator.js
Oliver Dixon

Saya tidak dapat menemukan (wtf)
Forhad

sangat buruk. Hal yang sama disini. Di versi XCode sebelumnya, saya harus mengubah version.startsWithke version.includes, yang telah diperbaiki. Sekarang, beberapa baris di bawah, ubah 'YA' menjadi benar… Cerita yang tidak pernah berakhir 😊
cokron

harus mengubahnya dalam paket komunitas, berhasil, terima kasih
matt93

30

Tidak ada simulator iPhone X di mesin Anda, kemungkinan besar karena Anda memperbarui Xcode. Anda cukup memberikan nama simulator yang tersedia seperti di bawah ini:

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

Untuk memeriksa simulator yang tersedia, Anda dapat membuka Xcode dan memeriksa daftar perangkat seperti yang ditunjukkan di bawah ini:

masukkan deskripsi gambar di sini


9

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

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


9

Setelah saya memperbarui Xcode ke versi 11, saya mengalami masalah yang sama.

Solusinya adalah menambahkan simulator iPhone X ke dalam daftar Anda.

  • Pilih simulator -> Hardware -> Kelola Perangkat (Anda akan melihat munculan)

  • Pilih "Simulators" -> (pojok kiri bawah) + (ikon plus, di sebelah "Filter") lalu tambahkan simulator baru,

  • Nama Simulator: Jenis Perangkat iPhone X: Pilih iPhone X.

Itu berhasil untuk saya


1
Ini adalah solusi 2019 yang tepat 👌
sospedra

Pasti cara untuk pergi. Mengalami 2 masalah kecil: 1- Harus memasangkan simulator "iPhone X" baru saya dengan runtime iOS 12.4 2- Harus mengganti simulator.isAvailable !== 'YES'dengan simulator.isAvailable !== truedalamnode_modules/@react-native-community/cli/build/commands/runIOS/findMatchingSimulator.js
delapan puluh lima

8

Saya juga tidak memasang iPhone X sebagai simulator di Xcode. Yang harus saya lakukan hanyalah menambahkan iPhone X sebagai simulator baru di Xcode dan semuanya baik-baik saja.

Di Xcode: Pergi ke Windowlalu Devices and Simulators. Klik tab simulator. Klik +tombol di sudut kiri bawah dan tambahkan iPhone X.

Saya harap perbaikan ini semudah bagi Anda seperti bagi saya.


Semudah ini, setidaknya bagi saya.
Chris

5

dalam kasus saya, saya menjalankan skrip: sed -i '' 's / beginWith / include / g' node_modules / react-native / local-cli / runIOS / findMatchingSimulator.js dan berhasil. juga cocok untuk orang yang tidak dapat memperbarui react-native


5

Untuk Xcode 11.2 dan iOS 13.2 berikut adalah perubahan yang telah saya lakukan untuk menjalankan aplikasi di simulator

di findMatchingSimulator.js

baris 43:

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

untuk

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

baris

baris 52

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

untuk

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

PS

Hari pertama iklan proyek React sudah dimulai! (tidak)


4

Masalah saya adalah simulator iPhone X tidak terpasang

Anda dapat memeriksa dengan apa simulator dipasang

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

Lalu lari

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

2

jika tidak dapat ditemukan simulator masih tetap ada setelah mengganti baris kode berikut di runSimulator.js.

Jalur untuk runSimulator.js -> /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

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

dengan yang satu ini

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

komentar baris berikut setelah mengganti

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

Ini akan meluncurkan simulator iPhone tanpa masalah apa pun.

dan pendekatan ke-2 setelah memperbarui ke XCode 11

Xcode 11 xcrun mengembalikan true atau false dan bukan YES atau NO untuk properti isAvailable seperti sebelumnya. Anda dapat memeriksanya menggunakan perintah berikut

xcrun simctl list devices --json 

perintah di atas akan mencetak semua perangkat yang tersedia seperti berikut

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

Gantikan YA dengan benar di kode berikut

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

seperti ini

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

Ya, itulah masalah saya adalah setelah memperbarui ke xcode 11 saya mulai mendapatkan kesalahan ini. mengganti 'YA' dengan benar melakukan pekerjaan itu.
Sudhir

2

perbaikan mudah ...

Xcode -> preferensi -> komponen menginstal ios 12.2 sumulator


@velvetlnk - milik saya hanya naik sejauh
Andrew Newby

instal versi ios apa pun di bawah 13
velvetInk

2

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

mengajukan

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'
  }

untuk

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'
  }

2

Saya mengalami kesalahan yang sama ketika saya memutakhirkan Xcode 10 saya ke Xcode 11, Tetapi menentukan versi simulator merupakan perbaikan cepat bagi saya.

Pertama daftarkan semua emulator ios yang tersedia dengan

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

Hasil Keluaran

Kemudian pilih satu untuk menjalankan react-native, misalnya

 react-native run-ios --simulator='iPhone 11 Pro Max'

ini seharusnya bekerja menurut saya tetapi tidak untuk saya, saya mencoba dengan simulator yang relevan buka dan tutup
Harry Moreno

1

Dengan react-native-cli 2.0.1, Anda mungkin ingin mengganti nama simulator Anda. Secara default Xcode akan memberi nama beberapa perangkat dalam format tersebut <DeviceName> (<DeviceSize>). Namun versi CLI ini menafsirkan semua yang ada di dalam tanda kurung sebagai versi iOS.

Saat mencoba menjalankan simulator bernama iPad Pro (10.5-inch), saya bisa menjalankannya hanya dengan mengganti nama simulator menjadiiPad Pro [10.5-inch] .

Anda dapat mengganti nama simulator dengan menggunakan menu aplikasi Simulator Hardware-> Device-> Manage Devices..., dan mengklik kanan salah satu simulator Anda (di Xcode 10.2.1)


1

Saya menghadapi masalah ketika saya memperbarui Xcode. Semua simulator tidak tersedia / dicopot pemasangannya. Saya menginstalnya lagi.


1

Dalam kasus saya, saya telah mencoba solusi lain di atas tetapi tidak ada yang berhasil.

Kemudian saya mencoba upgrade bereaksi-asli dari 0.59.5ke 0.59.10maka itu dipecahkan


Setelah mencoba semuanya, saya mengubah versi dari 0.59.5menjadi 0.59.10dan menyelesaikan masalah, saran bagus :)
Manoj Sehrawat


0

Bagi saya, saya harus memperbarui React Native ke 0.60 dengan menjalankan npx react-native-git-upgrade.


-1

Saya mengalami masalah yang sama setiap kali saya memperbarui Xcode.
Saya menjalankan perintah ini:

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

Lalu aku lari react-native run-ioslagi.


Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.