Xcode 9 错误:找不到 cdtool
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44471971/
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
Xcode 9 Bug: Cannot find cdtool
提问by Jason C. Howlin
After installing Xcode 9 beta, Xcode 8 gives me an error when compiling a project:
安装 Xcode 9 beta 后,Xcode 8 在编译项目时给我一个错误:
Cannot find cdtool at '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool': Cannot find a simulator runtime for platform
<DVTPlatform:0x7fd67af0a930:'com.apple.platform.iphonesimulator':<DVTFilePath:0x7fd67af0a7c0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform'>>
.
在“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool”中找不到 cdtool:找不到平台的模拟器运行时
<DVTPlatform:0x7fd67af0a930:'com.apple.platform.iphonesimulator':<DVTFilePath:0x7fd67af0a7c0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform'>>
。
I suspect Xcode 9 modified some shared state with Xcode 8 (set a path, overwrote a file, etc.). But I've tried deleting and both Xcodes to no avail.
我怀疑 Xcode 9 修改了一些与 Xcode 8 的共享状态(设置路径、覆盖文件等)。但我试过删除和两个 Xcode 都无济于事。
The project uses Core Data and it's clearly failing when trying to compile the xcdatamodel.
该项目使用 Core Data,并且在尝试编译 xcdatamodel 时显然失败了。
I can still compile and run under Xcode 9.
我仍然可以在 Xcode 9 下编译和运行。
回答by Jason C. Howlin
An Apple engineer reached out about this...
一位 Apple 工程师就此事联系了...
Those of you with cdtool errors in Xcode 8, I suspect you installed the iOS 10.3 Simulator runtime from Xcode 9. It was discovered this week that this causes a problem with cdtool in Xcode 8.3.
那些在 Xcode 8 中遇到 cdtool 错误的人,我怀疑您从 Xcode 9 安装了 iOS 10.3 Simulator 运行时。本周发现这会导致 Xcode 8.3 中的 cdtool 出现问题。
You can work around that by moving iOS 10.3.simruntime aside and restarting CoreSimulatorService (source):
您可以通过将 iOS 10.3.simruntime 移到一边并重新启动 CoreSimulatorService ( source) 来解决这个问题:
sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/Backup
sudo mv /Library/Developer/CoreSimulator/Profiles/Runtimes/{,Backup/}iOS\ 10.3.simruntime
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
Then restart Xcode, Simulator, etc. Those of you that deleted CoreSimulator.framework and thus cannot run Xcode.app any more can reinstall CoreSimulator.framework with:
然后重新启动 Xcode、Simulator 等。那些删除 CoreSimulator.framework 从而无法再运行 Xcode.app 的人可以重新安装 CoreSimulator.framework:
installer -pkg /Applications/Xcode-beta.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /
回答by Matt H
Didn't work for me because I also have a Watch app and got the error on the Watch SDK.
对我不起作用,因为我也有一个 Watch 应用程序并且在 Watch SDK 上遇到了错误。
I ended up deleting both Xcode 8 and 9 Beta, deleting /Library/Developer
and ~/Library/Developer
. Then reinstalled Xcode 8 and it worked.
我最终删除两个Xcode的8和9 Beta版,删除/Library/Developer
和~/Library/Developer
。然后重新安装 Xcode 8 并且它工作了。
回答by Dare2dream
You can also remove the 10.3 folder from
/Library/Developer/CoreSimulator/Profiles/Runtimes
您还可以从中删除 10.3 文件夹
/Library/Developer/CoreSimulator/Profiles/Runtimes
Restart Xcode in order to take effect (may not be needed).
重启 Xcode 才能生效(可能不需要)。
回答by Ajeet Sharma
I agree with C?ur. In addition I first removed all existing(took backup) Xcode version from machine.Then kept xcode 8.3.3 in Application folder. Made the project to open with default Xcode 8.3.2. Problem got resolved. The problem came when I updated Xcode 9 beta to 9.2.
我同意 C?ur。此外,我首先从机器中删除了所有现有(备份)Xcode 版本。然后将 xcode 8.3.3 保留在 Application 文件夹中。使项目以默认 Xcode 8.3.2 打开。问题得到解决。当我将 Xcode 9 beta 更新到 9.2 时,问题就出现了。