xcode 未找到 IOKit

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17542092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:35:15  来源:igfitidea点击:

IOKit Not found

xcodeios7xcode5iokit

提问by Nolan Anderson

So everything was fine, and then I decided to start developing on XCode 5 DP3 and iOS7

所以一切都很好,然后我决定开始在 XCode 5 DP3 和 iOS7 上开发

Prior to upgrading, my project compiled and ran fine on my iPhone 3GS (I made a little soft phone application); it didn't run on my iPhone 5, however; I was very confident that it was the fact that I hadn't configured it to include the armv7s architecture yet.

在升级之前,我的项目在我的 iPhone 3GS 上编译并运行良好(我做了一个小软电话应用程序);然而,它没有在我的 iPhone 5 上运行;我非常有信心,因为我还没有将它配置为包含 armv7s 架构。

I can build and run everything just fine on the simulators, but (and this is after configuring the app to include the armv7s architecture) I can't get it to run on either my devices.

我可以在模拟器上很好地构建和运行一切,但是(这是在配置应用程序以包含 armv7s 架构之后)我无法让它在我的任一设备上运行。

I get this error:

我收到此错误:

ld: framework not found IOKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm not even sure how one uses -v to see invocation. I read some where that IOKit is just for the simulator... does this mean that I should unlink it from my library when building on my device? And why wasn't I getting this error before when it was working on my 3gs?

我什至不确定如何使用 -v 来查看调用。我读了一些 IOKit 仅用于模拟器的地方……这是否意味着在我的设备上构建时我应该将它从我的库中取消链接?为什么我在我的 3gs 上工作之前没有收到这个错误?

My assumption for why it no longer works on my 3gs (although the error is the same), is the fact that it's iOS 6, and the SDK may only support iOS 7 (which my iPhone 5 currently is).

我对为什么它不再适用于我的 3gs 的假设(尽管错误是相同的)是因为它是 iOS 6,并且 SDK 可能只支持 iOS 7(我的 iPhone 5 目前是)。

回答by colin lamarre

Best thing to do is this until Apple issues a fix.

最好的办法是在 Apple 发布修复程序之前这样做。

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/IOKit.framework
sudo ln -s Versions/A/IOKit .

回答by Vitalya

I had the same problem, but I fixed it by going to IOKit.frameworkin Xcode 4.6.3, right clicking it, and selecting "Show in Finder". I just copied it to the same relative location under Xcode 5.

我遇到了同样的问题,但我通过IOKit.framework在 Xcode 4.6.3 中进行修复,右键单击它,然后选择“在 Finder 中显示”。我只是将它复制到 Xcode 5 下的相同相对位置。

回答by hfossli

Xcode Version 5.1.1 (5B1008)

Xcode 版本 5.1.1 (5B1008)

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/IOKit.framework 
sudo ln -s Versions/A/IOKit .

回答by MrBlonde

To fix this without rolling back your Xcode software you can add the missing IOKit.framework symlink by entering the following commands into terminal:

要在不回滚 Xcode 软件的情况下解决此问题,您可以通过在终端中输入以下命令来添加缺少的 IOKit.framework 符号链接:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ iPhoneOS7.0.sdk/System/Library/Frameworks/IOKit.framework

sudo ln -s Versions/A/IOKit . # <- do not forget the dot!

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/IOKit.framework

须藤 ln -s 版本/A/IOKit。# <- 不要忘记点!

Be sure to enter the entire directory address when performing the cd operation as the terminal will not like you changing the directory to an .app file usually.

执行cd操作时一定要输入完整的目录地址,因为终端通常不会喜欢你把目录改成.app文件。

Hope this solves your problem!

希望这能解决您的问题!

回答by AMIT

For iPhoneOS10.2.sdk

对于 iPhoneOS10.2.sdk

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/IOKit.framework

sudo ln -s Versions/A/IOKit .

须藤 ln -s 版本/A/IOKit。