Xcode 6 无法找到模拟器设备并超时

4

我已经提交了一个radar,因为我认为这是一个bug,但我想知道是否有人可以在此期间提供一个解决方法。

在安装有Xcode的机器上成功运行测试数周后,测试将不再执行。似乎Xcode无法再找到模拟器或其设备。从Xcode的设备菜单中删除模拟器设备(以及~/Library/Developer/CoreSimulator/Devices中的所有目录),然后重新添加它们并没有帮助。

模拟器无法启动,Xcode中也没有输出任何错误消息。在Console.app中打开system.log会显示以下消息:

Nov 21 16:21:29 jenkinss-mini.home xcodebuild[51853]: [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-6604/IDEFoundation/Testing/OCUnit/IDEOCUnitTestRunner.m:388
    Details:  No baseline file matching runDestinationRecord: {
        localComputer =     {
            busSpeedInMHz = 100;
            cpuCount = 1;
            cpuKind = "Intel Core i5";
            cpuSpeedInMHz = 2500;
            logicalCPUCoresPerPackage = 4;
            modelCode = "Macmini6,1";
            physicalCPUCoresPerPackage = 2;
            platformIdentifier = "com.apple.platform.macosx";
        };
        targetArchitecture = i386;
        targetDevice =     {
            modelCode = "iPhone5,1";
            platformIdentifier = "com.apple.platform.iphonesimulator";
        };
    }
    Object:   <Xcode3OCUnitTestRunner: 0x7fa0d6b61550>
    Method:   -_scheduledTestArgumentsOperationForBuildParameters:launchParameters:runDestination:workspace:testRunIdentifier:testRunIdentifiers:actionResultsBundleWithBaselineOverridesFilePath:error:completionBlock:
    Thread:   <NSThread: 0x7fa0d0514030>{name = (null), num = 1}
    Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

可能有帮助 - https://dev59.com/EV8e5IYBdhLWcg3wyMwr - Warren Burton
1个回答

9

删除~/Library/Developer/CoreSimulator/Devices中的设备不可取,因为这可能会在CoreSimulatorService运行时删除状态。 我建议您通过以下方式进行“清理”:

  1. 退出Xcode、iOS模拟器、Instruments和其他使用模拟器的应用程序
  2. 杀死服务:killall -9 com.apple.CoreSimulator.CoreSimulatorService
  3. 删除状态:rm -rf ~/Library/*/CoreSimulator

这样应该会将您恢复到初始状态。

如果这并没有完全解决您的问题,请在重现问题后将~/Library/Logs/CoreSimulator/CoreSimulator.log更新到您的问题中。 请注意,您应该先启用调试日志记录:

defaults write com.apple.iphonesimulator DebugLogging -bool YES
defaults write com.apple.CoreSimulator DebugLogging -bool YES

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接