Xcode 'unable to execute command: Segmentation fault: 11'

2,663 阅读1分钟

问题

iOS开发,在虚拟机上使用Xcode编译项目时,可能会遇到编译报错「unable to execute command: Segmentation fault: 11」,详情如下:

clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: arm64-apple-ios8.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: error: unable to execute command: Segmentation fault: 11
clang: note: diagnostic msg: Error generating preprocessed source(s).

原因

项目文件放在了虚拟机共享文件夹

解决方案

将项目从共享文件夹移到虚拟机「硬盘」其他目录即可。