代码之家  ›  专栏  ›  技术社区  ›  Sanoj Kashyap

模拟器继续崩溃并重新打开

  •  0
  • Sanoj Kashyap  · 技术社区  · 6 年前

    今天,我把我的imac从macos high sierra更新为macos mojave。从那以后我就不能打开模拟器了。每次我试图打开模拟器,它都会立即崩溃。每当我试图通过xcode运行模拟器时,xcode就会显示这个错误

    等待iphonesimulator的模拟器应用程序准备就绪时超时

    enter image description here

    另外,我试图直接打开模拟器,它立即崩溃。这里的gif(gif有点慢)-

    enter image description here enter image description here

    系统CPU和内存状态 -

    enter image description here

    enter image description here

    这里有一些我试过但没有成功的解决方案-

    1. 清除iPhone模拟器缓存

      xcrun simctl erase all
      
    2. 清除派生数据

      ~/Library/Developer/Xcode/DerivedData/
      
    3. 清除iOS设备支持

      ~/Library/Developer/Xcode/iOS DeviceSupport/
      
    4. 删除Xcode首选项

      defaults delete com.apple.dt.Xcode
      
    5. 重新启动xcode&system


    更新1

    马科斯原木

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Device iPhone XS (978302BA-5255-44CB-A77C-188071B99A7C, iOS 12.0, Booted) is available but has no defaultDisplay'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x00007fff33a9543d __exceptionPreprocess + 256
        1   libobjc.A.dylib                     0x00007fff5f9a6720 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff33ab008e +[NSException raise:format:arguments:] + 98
        3   Foundation                          0x00007fff35e4c55d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
        4   Simulator                           0x000000010e7510da Simulator + 106714
        5   libdispatch.dylib                   0x00007fff60a24d4f _dispatch_call_block_and_release + 12
        6   libdispatch.dylib                   0x00007fff60a25dcb _dispatch_client_callout + 8
        7   libdispatch.dylib                   0x00007fff60a2c120 _dispatch_lane_serial_drain + <…>
    )
    
    0 回复  |  直到 6 年前
        1
  •  50
  •   Vineet Choudhary    6 年前

    此命令应解决您的问题(关闭SIM卡之前和打开之后):

    sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService
    

    在此之后,重新启动xcode,如果模拟器不可用,则需要从 Windows gt; Device and Simulators

    enter image description here