objective-c - 为什么在使用 XCode 和 xcodebuild 之间存在差异?

标签 objective-c xcode macos xcodebuild

谁能解释为什么我在使用 GUI 和 xcodebuild 命令行编译同一个 XCode 4.x 项目时得到不同的结果?

XCode 图形用户界面

  1. 执行清洁
  2. 建立“发布”目标
  3. 构建成功

xcodebuild

  1. 执行清洁
  2. 运行“xcodebuild -configuration Release”
  3. 导致以下错误:

    /Developer/usr/bin/gcc-4.0 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn- type -Wunused-variable -isysroot/Developer/SDKs/MacOSX10.4u.sdk -fvisibility=hidden -mmacosx-version-min=10.4 -c "/Users/XXX/Extensions/NSFileManager_Extensions.m"-o "/Users/XXX/Developer/Intermediates/YourApp.build/Release/YourApp.build/Objects-normal/ppc/NSFileManager_Extensions.o” /Users/XXX/Extensions/NSFileManager_Extensions.m:15:60: 错误:ToxicRegularExpressions/ToxicRegularExpressions.h: 没有这样的文件或目录 ** 构建失败 **

以下构建命令失败: CompileC“/Users/XXX/Developer/Intermediates/YourApp.build/Release/YourApp.build/Objects-normal/ppc/NSFileManager_Extensions.o”/Users/XXX/Extensions/NSFileManager_Extensions.m 正常 ppc objective-c com.apple。编译器.gcc.4_0

最后是GUI + xcodebuild

  1. 在 GUI 中执行清理
  2. 建立“发布”目标
  3. 构建成功
  4. 运行“xcodebuild -configuration Release”
  5. 构建成功

最佳答案

尝试在命令行上传递 SDK,如下所示:

xcodebuild -configuration Release -sdk iphonesimulator3.0

关于objective-c - 为什么在使用 XCode 和 xcodebuild 之间存在差异?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1498670/

相关文章:

iphone - Obj-C 类发出异步请求

ios - 发送到释放实例的 UITextField textInputView 消息

iphone - numberOfRowsInSection - 无法识别的选择器发送到实例问题

.net - macOS 中的 dotnet 核心 : "The type initializer for ' Crypto' threw an exception"

ios - 如何在 HealthKit 中获取 HKWorkoutActivityType 的名称?

iOS:我的 ViewController 出现问题,其中包含在选项卡栏中显示为黑色或显示大小错误的 TableView

ios - XCODE 8.2 错误地检测到锁定的设备

html - 为什么 Windows 和 Mac OS X 上的行高存在 @font-face 差异?

ios - 暂时禁用通用剪贴板

iphone - 使用 UIProgressView 进行图像编辑