XCode 升级到 XCode10.3 项目报错

报错信息:

Failed to find or create execution context for description ‘<IBCocoaTouchPlatformToolDescription: 0x7fe0ddceada0> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fe0dd8606b0> scaleFactor=2x’. These intermediate objects were non-nil: (

详细信息:

CompileStoryboard /Users/it/Git/imapp/imapp/Launch\ Screen.storyboard (in target: imapp)
    cd /Users/it/Git/imapp
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module imapp --output-partial-info-plist /Users/it/Library/Developer/Xcode/DerivedData/imapp-aeprheuvgyqhvydumnpjaqtvqwtq/Build/Intermediates.noindex/imapp.build/Debug-iphonesimulator/imapp.build/Launch\ Screen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --target-device ipad --minimum-deployment-target 9.0 --output-format human-readable-text --compilation-directory /Users/it/Library/Developer/Xcode/DerivedData/imapp-aeprheuvgyqhvydumnpjaqtvqwtq/Build/Intermediates.noindex/imapp.build/Debug-iphonesimulator/imapp.build /Users/it/Git/imapp/imapp/Launch\ Screen.storyboard

2019-07-26 11:15:26.166 ibtoold[35829:13410674] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fe0ddceada0> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fe0dd8606b0> scaleFactor=2x: Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x7fe0ddceada0> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fe0dd8606b0> scaleFactor=2x'. These intermediate objects were non-nil: (
    "IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x)",
    "iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4"
): Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) with runtime iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4 (Failure reason: Failed to create new simulator device that matches IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) for runtime iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4 (Invalid runtime: com.apple.CoreSimulator.SimRuntime.iOS-12-4)): Invalid runtime: com.apple.CoreSimulator.SimRuntime.iOS-12-4
/* com.apple.ibtool.errors */
/Users/it/Git/imapp/imapp/Launch Screen.storyboard: error: Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x7fe0ddceada0> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fe0dd8606b0> scaleFactor=2x'. These intermediate objects were non-nil: (
    "IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x)",
    "iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4"
)
    Underlying Errors:
        Description: Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) with runtime iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4
        Failure Reason: Failed to create new simulator device that matches IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) for runtime iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4 (Invalid runtime: com.apple.CoreSimulator.SimRuntime.iOS-12-4)
        Underlying Errors:
        Description: Invalid runtime: com.apple.CoreSimulator.SimRuntime.iOS-12-4

解决方法:

Kill all simulator processes

$ sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

Set the correct Xcode path

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

If that doesn’t work, reset all simulators

$ xcrun simctl erase all