反应原生指定设备模拟器不工作

时间:2018-01-26 06:54:19

标签: reactjs react-native create-react-native-app

我已使用create-react-native-app创建了一个项目。当我运行xcrun simctl list devices时,我得到以下输出:

== Devices ==
-- iOS 11.2 --
    iPhone 5s (C6BA18E9-4758-492B-9F54-8BA1D52640C1) (Shutdown)
    iPhone 6 (3CD96F5D-BFDE-409A-A6C3-D84FFCDA86EC) (Shutdown)
    iPhone 6 Plus (47DE6DC8-195D-4A08-9E42-941C5DA9CCD6) (Shutdown)
    iPhone 6s (94D99B3A-5617-476F-AD53-4B9ADA1EF742) (Shutdown)
    iPhone 6s Plus (594343D2-3BD8-4A36-BAEB-54AD4FE44AC1) (Shutdown)
    iPhone 7 (B7B790BA-8106-4BFB-ACAC-761BCA1A2EA2) (Shutdown)
    iPhone 7 Plus (858E98D8-0C89-4F21-99C4-57D7B76093DD) (Shutdown)
    iPhone 8 (D46C1A38-AACC-445C-B184-FEF2CC0AE3BB) (Shutdown)
    iPhone 8 Plus (51CA5477-46C1-45D7-B88A-6B49AD24F9D9) (Shutdown)
    iPhone SE (8C8484F4-0E36-4BE7-B3DD-7DE340B8E29E) (Shutdown)
    iPhone X (E31D9BAF-99BF-4FC7-8F61-0FE37C3D842E) (Shutdown)
    iPad Air (A4A11F1F-A9EA-4688-8D21-22B3EFF3B8EE) (Shutdown)
    iPad Air 2 (4DB3DC6F-1D28-48FC-9D9A-687782E3EE5B) (Shutdown)
    iPad (5th generation) (48440402-3990-48E2-A3F0-8EF78260127F) (Shutdown)
    iPad Pro (9.7-inch) (A4AF659D-9C9C-4B56-8DF2-859F8E69512F) (Shutdown)
    iPad Pro (12.9-inch) (AB3EC407-BB31-47E5-9A80-5D799F971684) (Shutdown)
    iPad Pro (12.9-inch) (2nd generation) (0692490A-CC3E-485D-8602-B9E2B2C0D524) (Shutdown)
    iPad Pro (10.5-inch) (EFBF1A00-29CB-4AFA-86C7-9FA49177E9E1) (Shutdown)
-- tvOS 11.2 --
    Apple TV (34A1499A-E075-4A15-9E14-F54BB34F43DE) (Shutdown)
    Apple TV 4K (CAFE311F-009F-4011-91F6-34ED43EDE080) (Shutdown)
    Apple TV 4K (at 1080p) (181E90D6-E0C8-4E8A-9B31-7900C1605E87) (Shutdown)
-- watchOS 4.2 --
    Apple Watch - 38mm (4C655D2C-035F-4A8C-8D09-3E5BC5CED468) (Shutdown)
    Apple Watch - 42mm (A0B27D4A-A297-4139-8B44-BB2C64C39E48) (Shutdown)
    Apple Watch Series 2 - 38mm (BB2AF7A4-6E28-4FE8-85D8-1089014DCDCC) (Shutdown)
    Apple Watch Series 2 - 42mm (67078745-2DA3-4854-BED9-54629A0128D0) (Shutdown)
    Apple Watch Series 3 - 38mm (C211E315-9A60-4344-AD33-FF67E8B5D69E) (Shutdown)
    Apple Watch Series 3 - 42mm (16FBF335-B09D-452E-AE02-308807C9B7C2) (Shutdown)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-11-1 --
    iPhone 5s (D9F91002-B6E0-4A21-8321-54ACD8ECED54) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (BCC20CEF-4D85-4362-B7DC-17E55AFE6FD0) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (B12D510D-D80C-4891-B8B8-BE6790D18762) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (87E0A245-9B96-4B27-B9EE-C4F26CDD11F8) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (145D6FF6-AF4A-4B59-8668-159529FDEE4A) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (FCB17479-950F-4583-A2E4-EE58389717F9) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (971DDD11-C50C-48A1-A918-7B2C30CA9585) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 (5491C75D-5358-4034-ACD7-83868A2CEFA8) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 Plus (DADCD90B-B241-44AD-A8AB-E2FA0BFB6462) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (80BDDC15-A97A-4953-BD33-3B03817ED20A) (Shutdown) (unavailable, runtime profile not found)
    iPhone X (2F21CCBC-5639-4EE9-8660-2C079B85BAAD) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (BEA0D086-FDA5-4ECE-8060-D0B0E8888AFA) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (5B69B2DD-E8E7-42CF-B8D1-28723FE5C53E) (Shutdown) (unavailable, runtime profile not found)
    iPad (5th generation) (BE1C8914-B3C0-400C-BA1E-73DE59A6200F) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7-inch) (8366B119-D2DC-4361-AE1C-B6F68509236E) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (CAD13756-E7A3-4BB3-886F-AD3087D8777F) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2nd generation) (CF04B197-28F0-4CBA-B21B-10266BD53B7A) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (10.5-inch) (8F89A680-7F95-46B2-8D45-6B7B50647123) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.tvOS-11-1 --
    Apple TV (8E5E27EA-59BF-4A2A-9703-7658B014255C) (Shutdown) (unavailable, runtime profile not found)
    Apple TV 4K (A076BB4A-739E-40AD-9C92-0EDE3478B86C) (Shutdown) (unavailable, runtime profile not found)
    Apple TV 4K (at 1080p) (96D28346-820F-4FAA-8BD2-285EED8F54B8) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.watchOS-4-1 --
    Apple Watch - 38mm (88F35A30-DC10-4682-AD8B-EB471EFB960A) (Shutdown) (unavailable, runtime profile not found)
    Apple Watch - 42mm (17847FDC-DF09-49F1-AA20-621AD94E1A77) (Shutdown) (unavailable, runtime profile not found)
    Apple Watch Series 2 - 38mm (7884C077-A8E3-4D45-B503-E147EDD2C1B9) (Shutdown) (unavailable, runtime profile not found)
    Apple Watch Series 2 - 42mm (4C4501F3-20D0-4BB4-ABE4-2F6ADDD8A448) (Shutdown) (unavailable, runtime profile not found)
    Apple Watch Series 3 - 38mm (059757A9-A2AB-4F3D-AF8C-81D6CC59BC76) (Shutdown) (unavailable, runtime profile not found)
    Apple Watch Series 3 - 42mm (918B8756-6C40-4C41-B939-109A8144F8B6) (Shutdown) (unavailable, runtime profile not found)

因此,当我尝试在iPhone 8上运行我的应用程序时,例如: react-native run-ios --simulator="iPhone 8"

它仍然会启动iPhone X模拟器。我做错了什么?

1 个答案:

答案 0 :(得分:1)

打开模拟器,转到硬件>装置> iOS> iPhone 8。

关闭另一个模拟器(关闭电源或选择+ ctrl w),然后关闭react-native run-ios