在 Xcode 6 和 Xcode 4.5 之间切换

Posted

技术标签:

【中文标题】在 Xcode 6 和 Xcode 4.5 之间切换【英文标题】:Switch between Xcode 6 and Xcode 4.5 【发布时间】:2014-12-29 18:51:31 【问题描述】:

使用 OS X Yosemite

删除了 Xcode6,并按照本指南安装了 Xcode 4.5: http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html

在不同的文件夹下安装 Xcode 4.5 并使用命令“sudo xcode-select --switch /Applications/Xcode4.5/Xcode.app”(在终端中)切换到新的 Xcode4.5 版本(来自上面的指南)。

收到一条错误消息,指出在首次启动时安装了不兼容的“MobileDevice.Framework”。按照本指南解决该问题:Xcode 4.4.1 does not work properly under OSX Mavericks 从上面的堆栈溢出问题运行命令:“sudo rm -rf /System/Library/PrivateFrameworks/MobileDevice.framework”后,我遇到了另一个经过多天研究后无法解决的错误:

Process:               Xcode [2422]
Path:                  /Applications/Xcode4.5.2/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               4.5.2 (1847)
Build Info:            IDEApplication-1847000000000000~5
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [2422]
User ID:               501

Date/Time:             2014-12-29 13:36:32.026 -0500
OS Version:            Mac OS X 10.10.1 (14B25)
Report Version:        11
Anonymous UUID:        1076DD40-2DC4-A657-02AE-90EA3278917B


Time Awake Since Boot: 4200 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4G2008a
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Extension Xcode.Device.iPhone class 'DVTiPhoneLocator' not found for required key 'locatorClass'
UserInfo: 
  DVTExtensionClassNameErrorKey = DVTiPhoneLocator;
  DVTExtensionIdentifierErrorKey = "Xcode.Device.iPhone";
  DVTPlugInExecutablePathErrorKey = "/Applications/Xcode4.5.2/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEiPhoneSupport.ideplugin";
  DVTPlugInIdentifierErrorKey = "com.apple.dt.IDE.IDEiPhoneSupport";

Hints: None
Backtrace:
0  0x00007fff85859634 __exceptionPreprocess (in CoreFoundation)
1  0x00007fff8b2ac6de objc_exception_throw (in libobjc.A.dylib)
2  0x0000000109c1eff1 -[DVTExtension _adjustClassAttribute:forKey:inParameterData:] (in DVTFoundation)
3  0x0000000109c1ec56 -[DVTExtension _adjustClassReferencesInParameterData:usingSchema:] (in DVTFoundation)
4  0x0000000109c7554f -[DVTExtension _fireExtensionFault:] (in DVTFoundation)
5  0x0000000109c75110 __63-[DVTExtension _valueForKey:inParameterData:usingSchema:error:]_block_invoke_0 (in DVTFoundation)
6  0x0000000109c9c446 __DVTDispatchSync_block_invoke_0 (in DVTFoundation)
7  0x00007fff8b210c13 _dispatch_client_callout (in libdispatch.dylib)
8  0x00007fff8b211e5e _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)
9  0x0000000109c9c263 DVTDispatchSync (in DVTFoundation)
10  0x0000000109c9c077 DVTSyncPerformBlock (in DVTFoundation)
11  0x0000000109bf917d -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
12  0x0000000109c75007 -[DVTExtension _valueForKey:inParameterData:usingSchema:error:] (in DVTFoundation)
13  0x0000000109c1e40d -[DVTExtension valueForKey:] (in DVTFoundation)
14  0x0000000109c23c03 +[DVTDevice _knownDeviceLocators] (in DVTFoundation)
15  0x0000000109c237bc -[DVTDeviceManager startLocating] (in DVTFoundation)
16  0x000000010a50d3d3 __IDEInitialize_block_invoke_0 (in IDEFoundation)
17  0x000000010a50d986 IDESetSafeToLoadMobileDevice (in IDEFoundation)
18  0x000000010a81f6e3 -[IDEWelcomeWindowController _showFirstLaunchExperienceIfAppropriate] (in IDEKit)
19  0x000000010a81f604 -[IDEWelcomeWindowController openWelcomeWindowAfterFirstLaunchExperienceIfAppropriate:] (in IDEKit)
20  0x000000010a81f56e -[IDEApplicationController applicationOpenUntitledFile:] (in IDEKit)
21  0x00007fff8dcdfa5a -[NSApplication _doOpenUntitled] (in AppKit)
22  0x00007fff8dc18b91 __58-[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]_block_invoke (in AppKit)
23  0x00007fff8e33e5b0 __95-[NSPersistentUIManager restoreAllPersistentStateRegisteringAsReadyWhenDone:completionHandler:]_block_invoke557 (in AppKit)
24  0x00007fff8df22389 __97-[NSDocumentController(NSInternal) _autoreopenDocumentsIgnoringExpendable:withCompletionHandler:]_block_invoke_3 (in AppKit)
25  0x00007fff8df21d81 -[NSDocumentController(NSInternal) _autoreopenDocumentsIgnoringExpendable:withCompletionHandler:] (in AppKit)
26  0x00007fff8dc11354 -[NSPersistentUIRestorer finishedRestoringWindowsWithZOrder:completionHandler:] (in AppKit)
27  0x00007fff8dac262c -[NSPersistentUIRestorer restoreStateFromRecords:usingDelegate:completionHandler:] (in AppKit)
28  0x00007fff8dac1c91 -[NSPersistentUIManager restoreAllPersistentStateRegisteringAsReadyWhenDone:completionHandler:] (in AppKit)
29  0x00007fff8dac0f37 -[NSApplication _reopenWindowsAsNecessaryIncludingRestorableState:registeringAsReady:completionHandler:] (in AppKit)
30  0x00007fff8dac0c69 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] (in AppKit)
31  0x00007fff8dac06b5 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] (in AppKit)
32  0x00007fff8621a458 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] (in Foundation)
33  0x00007fff8621a2c9 _NSAppleEventManagerGenericHandler (in Foundation)
34  0x00007fff920d499c aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) (in AE)
35  0x00007fff920d4719 dispatchEventAndSendReply(AEDesc const*, AEDesc*) (in AE)
36  0x00007fff920d4623 aeProcessAppleEvent (in AE)
37  0x00007fff8fcdb37e AEProcessAppleEvent (in HIToolbox)
38  0x00007fff8dabcd76 _DPSNextEvent (in AppKit)
39  0x00007fff8dabbe80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
40  0x00007fff8daafe23 -[NSApplication run] (in AppKit)
41  0x00007fff8da9b2d4 NSApplicationMain (in AppKit)
42  0x0000000109bead17 (in Xcode)
43  0x0000000109beaca8 (in Xcode)

【问题讨论】:

【参考方案1】:

从 10.10 开始,似乎无法让 xcode 4.5 和 xcode 4.4 工作(尽管 OSX 10.9 允许解决此问题)

所以如果你想启动它们,你应该使用 OSX 10.9 (Mavericks)。

还有... 为什么要使用 Xcode 4.5?我不知道有什么理由使用它。

Xcode 4.4.1 - 允许在 armv6 设备上调试的最后一个版本。

Xcode 4.6.3 - 包含 iOS 7 设计之前的最后一个 SDK (SDK 6.1)。

但是 Xcode 4.5.2 的原因是什么?

【讨论】:

以上是关于在 Xcode 6 和 Xcode 4.5 之间切换的主要内容,如果未能解决你的问题,请参考以下文章

XCode 4.5 iOS 6.0 模拟器和旋转问题

UITableView 不再使用 xCode 4.5 滚动,部署在 5.x 或 6.0

Xcode 4.5 无法识别我的设备 iphone 5 (6.1.3)

XCode 4.5 警告父/子类的类别之间的方法名称冲突

IOS 6.0 xcode 4.5 编译错误#import 代码保存在类外的文件中

Xcode 4.5 与 iOs 6 在 iOs 4.3 中的问题