简体   繁体   中英

Xcode 6 is unable to find Simulator device and times out

I have filed a radar , as I believe it's a bug, but I was wondering if anyone might be able to suggest a work-around in the meantime.

After successfully running tests regularly for weeks on a machine with Xcode installed, the tests will no longer execute. It appears that Xcode can no longer find the Simulator or its devices. Deleting the Simulator devices from the Devices menu in Xcode (and all directories in ~/Library/Developer/CoreSimulator/Devices ) and adding them back again does not help.

The Simulator does not launch and no error messages are output in Xcode. Opening system.log in Console.app reveals the following message:

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.

Deleting the devices in ~/Library/Developer/CoreSimulator/Devices is not advisable as you might be deleting state out from under CoreSimulatorService while it is running. I suggest you "clean up" by doing the following:

  1. Exit Xcode, iOS Simulator, Instruments, and anything else using the sim
  2. Kill the service: killall -9 com.apple.CoreSimulator.CoreSimulatorService
  3. Delete the state: rm -rf ~/Library/*/CoreSimulator

That should return you to a vanilla state.

If this does not completely solve your problem, please update your question with ~/Library/Logs/CoreSimulator/CoreSimulator.log after reproducing the issue. Note that you should first enable debug logging:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM