我当前正在运行 Xcode 6 beta 2,但找不到 UIKit.framework。 我按照 Apple 参考页面
中的建议查看了系统/库/框架除了 UIKit 之外,所有其他框架都在那里。
注意:我导入 UIKit 框架没有任何问题
在较新的 Xcode 版本中,iPhoneOS 框架不再包含二进制文件,而是包含一个 tbd 文件。您可以在此路径找到模拟器二进制文件:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks
新地点:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks
UIKit.framework在这里
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
我在这里找到了iOS 14,Xcode 12路径
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIKit.framework/UIKit
Xcode 12 中 UIKitCore(实际上包含 UIKit 中的所有内容)的路径是:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
我猜您已经发现了,但仅供记录:UIKit.framework 仅在 iOS 平台上可用。路径 /System/Library/Frameworks/ 包含 Mac OS X 已安装的框架(不是 Xcode)。
iOS项目中使用的iOS框架,至少在使用Xcode时,如下:
/Applications/Xcode6-Beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks
路径的 Xcode6-Beta4.app 部分是应用程序文件夹中 Xcode 的应用程序名称,如果您安装了其他版本,则可能会有所不同。此外,如果您使用其他 SDK 版本(例如 iOS 7.0),iPhoneOS8.0.sdk 可能会有所不同。
编辑:如果 UIKit.framework 存在,那么您可能更改了 Xcode 中的某些配置。更简单的修复方法可能是删除它并重新安装。
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
已更新 Xcode 11.3:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIKit.framework
您可以在 Mac(已安装 Xcode)和 iOS 中找到 UIKit Mach-O 文件:
在mac中,UIKit的路径是
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
(对于Xcode 14.2)
在iOS中,有一个图像文件:
/System/Library/Caches/com.apple.dyld/dyld_shared_cache_X
,你可以使用dsc_extrator将该图像文件的所有内容提取到一个目录中(如arm64
)。那么UIKit位于arm64/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
对于 Xcode 15 和 iOS 17,
UIKitCore.framework
位于此处:
/Users/{USERNAME}/Library/Developer/Xcode/iOS DeviceSupport/{IPHONE_MODEL} ({IOS_VERSION})/Symbols/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
另请参阅此相关帖子。