我刚买了一台新Mac并下载了Xcode,所以一切都很新鲜。在第一次打开Xcode时,我不小心告诉它打开我的src /文件夹而不是/ src / myLatestProject所以我的预感是Xcode去了并试图打开我的src /目录中的每个项目(数百)。它在海滩上停留了几秒钟然后坠毁了。现在的问题是,Xcode似乎记得我想要在app启动时打开多个项目,或者它正在尝试解析数百个git repos并且我陷入了开放/滩球/崩溃炼狱。如何重置Xcode的prefs,以便它不会尝试如此有用并打开我的计算机上的每一点源代码?
编辑:我已经确认它只会导致我的帐户崩溃。如果我创建一个测试用户并打开Xcode,一切都很好。 Application Specific Information:
ProductBuildVersion: 5A3005
ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/Xcode3Model/Xcode3OCUnitTestableDataSource.m:191
Details: ([_indexableIdsToTestableTokens objectForKey:indexableIdentifier]) should be nil, but it is <Xcode3OCUnitTestableDataSourceToken: 0x7fe73b531ae0>
Object: <Xcode3OCUnitTestableDataSource: 0x7fe7359c79f0>
Method: -setTestableToken:indexableIdentifier:
Thread: <NSThread: 0x7fe732415570>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x0000000109575ea8 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x00000001082fc7a5 _DVTAssertionHandler (in DVTFoundation)
2 0x00000001082fcad4 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x000000010e8ef3ca -[Xcode3OCUnitTestableDataSource setTestableToken:indexableIdentifier:] (in DevToolsCore)
4 0x000000010e8f2261 -[Xcode3OCUnitTestableDataSourceToken _initWithDataSource:indexableIdentifier:callbackBlock:] (in DevToolsCore)
5 0x000000010e8ef87d +[Xcode3OCUnitTestableDataSource testableDataSourceTokenForWorkspace:indexableIdentifier:callbackBlock:] (in DevToolsCore)
6 0x000000010ea0a464 -[Xcode3OCUnitTestable initWithTarget:] (in DevToolsCore)
7 0x000000010e9d7b69 -[Xcode3Project _updateTestablesForTargetProxies:] (in DevToolsCore)
8 0x000000010e9d074d -[Xcode3Project syncTargetProxiesWithProjectTargets] (in DevToolsCore)
9 0x000000010830e618 -[NSObject(DVTObservingConvenience) _dvt_newObserverForKeyPath:options:owner:withHandlerBlock:] (in DVTFoundation)
10 0x000000010828e5d3 -[NSObject(DVTObservingConvenience) dvt_newObserverForKeyPath:options:withHandlerBlock:] (in DVTFoundation)
11 0x000000010e9d1815 -[Xcode3Project initWithFilePath:extension:workspace:error:] (in DevToolsCore)
12 0x0000000108d899ef __73+[IDEContainer retainedContainerAtFilePath:fileDataType:workspace:error:]_block_invoke_2 (in IDEFoundation)
13 0x00007fff91d9d2ad _dispatch_client_callout (in libdispatch.dylib)
14 0x00007fff91d9e166 _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)
15 0x000000010833a0ec DVTSyncPerformBlock (in DVTFoundation)
16 0x000000010825dfe3 -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
17 0x0000000108d893f5 __73+[IDEContainer retainedContainerAtFilePath:fileDataType:workspace:error:]_block_invoke (in IDEFoundation)
18 0x000000010830f2ed -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation)
19 0x0000000108cc9579 +[IDEContainer retainedContainerAtFilePath:fileDataType:workspace:error:] (in IDEFoundation)
20 0x0000000108d9eb40 -[IDEFileReference _recalculateReferencedContainer] (in IDEFoundation)
21 0x0000000108cdcf48 -[IDEFileReference referencedContainer] (in IDEFoundation)
22 0x0000000108ce4200 -[IDEContainerQuery _traverseContainerGraphObject:forDeletion:checkedContainers:insertedMatches:deletedMatches:] (in IDEFoundation)
23 0x0000000108ce617b -[IDEContainerQuery _traverseContainerGraphObjects:forDeletion:insertedMatches:deletedMatches:] (in IDEFoundation)
24 0x0000000108ce5ec4 -[IDEContainerQuery _objectsDidChange:] (in IDEFoundation)
25 0x00007fff8d6eefcc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ (in CoreFoundation)
26 0x00007fff8d5e2c5d _CFXNotificationPost (in CoreFoundation)
27 0x00007fff8a3c14aa -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
28 0x00000001082a7085 -[DVTModelObjectGraph _coalescingTick] (in DVTFoundation)
29 0x0000000108cd1912 -[IDEGroup _setSubitems:] (in IDEFoundation)
30 0x0000000108cdee30 -[IDEFolder _updateSubitemsWithFileNames:] (in IDEFoundation)
31 0x0000000108d8eedb __32-[IDEFolder _filePathDidChange:]_block_invoke94 (in IDEFoundation)
32 0x0000000108339fdc __DVTAsyncPerformBlock_block_invoke (in DVTFoundation)
33 0x00007fff8d6517cc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ (in CoreFoundation)
34 0x00007fff8d642ee5 __CFRunLoopDoBlocks (in CoreFoundation)
35 0x00007fff8d64282b __CFRunLoopRun (in CoreFoundation)
36 0x00007fff8d642275 CFRunLoopRunSpecific (in CoreFoundation)
37 0x00007fff8b8aef0d RunCurrentEventLoopInMode (in HIToolbox)
38 0x00007fff8b8aecb7 ReceiveNextEventCommon (in HIToolbox)
39 0x00007fff8b8aeabc _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
40 0x00007fff8ad0e28e _DPSNextEvent (in AppKit)
41 0x00007fff8ad0d8db -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
42 0x00007fff8ad019cc -[NSApplication run] (in AppKit)
43 0x00007fff8acec803 NSApplicationMain (in AppKit)
44 0x00007fff89ff25fd start (in libdyld.dylib)
答案 0 :(得分:16)
不确定是哪一个修复它但是我在终端中运行了以下内容,现在又重新运行了:
cd ~/Library
sudo rm -rf './Preferences/com.apple.dt.Xcode.plist' './Autosave Information/com.apple.dt.Xcode.plist' './Autosave Information/Unsaved Xcode Document.xcworkspace' './Caches/com.apple.dt.Xcode'
警告:请注意,这可能会删除其他首选项,例如键绑定,因此如果您对xcode环境进行了大量自定义,请注意。
答案 1 :(得分:10)
打开查找程序并转到以下路径并删除创建的文件夹,这些是我们在xcode中暂时打开任何项目时创建的文件夹:
/Users/MyMac/Library/Developer/Xcode/DerivedData/
答案 2 :(得分:2)
在我的Xcode6 / Yosemite mac上,没有&#34;自动保存信息&#34;文件夹,所以我删除了~/Library/Saved Application State/com.apple.dt.Xcode.savedState
文件夹,它停止了崩溃。
答案 3 :(得分:1)
如果您在新窗口中有任何打开的swift文件(例如,当您在xCode中双击.swift文件并在新窗口中打开时),当xCode打开时,这可能是个问题。我想在关闭xCode时打开了这个窗口,然后在打开xCode时,这个窗口再次打开,由于某种原因导致xCode崩溃。尝试在崩溃前快速关闭此打开的窗口。奇怪,但这对我有用。
答案 4 :(得分:0)
让Xcode崩溃的场景在我身边有点不同。的确,我有同样的callstack错误:
Application Specific Information:
ProductBuildVersion: 5A3005
ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/Xcode3Model/Xcode3OCUnitTestableDataSource.m:191
Details: ([_indexableIdsToTestableTokens objectForKey:indexableIdentifier]) should be nil, but it is <Xcode3OCUnitTestableDataSourceToken: 0x7fe73b531ae0>
Object: <Xcode3OCUnitTestableDataSource: 0x7fe7359c79f0>
Method: -setTestableToken:indexableIdentifier:
Thread: <NSThread: 0x7fe732415570>{name = (null), num = 1}
Hints: None
但我必须复制一个现有项目(.xcodeproj文件),以便在我的工作区中拥有一个应用程序,具体取决于我工作区中的其他项目(构建阶段中的目标依赖项)(用作调试应用程序)和应用程序不是取决于只链接到相应项目目标的结果构建输出的任何东西(在我的案例中,链接二进制内部框架内的构建阶段中的库)。问题是,每次我将重复的项目导入我的工作区时,它都会崩溃Xcode ......由于崩溃堆栈跟踪正在讨论测试事项,我只是通过project.pbxproj并删除了该文件中出现的所有测试字符串(以及我工具关心部分,以避免破坏我的文件。)
prject中重复的xctest目标出了问题。一旦我再次尝试在我的工作区中再次导入它,它工作正常。
希望它可以提供帮助
答案 5 :(得分:0)
答案 6 :(得分:0)
如果您有工作区,没有解决方案适用于我。但我发现了一个..
删除工作区文件(如果有)。使用终端中的“pod install”再次安装pod(需要移动到项目文件夹)。
再次打开工作区..它将解决此问题
答案 7 :(得分:0)
您也可以做一件事(如果您使用的是Pod):-