【问题标题】:Why getting differences between using XCode and xcodebuild?为什么在使用 XCode 和 xcodebuild 之间存在差异?
【发布时间】:2009-09-30 14:59:59
【问题描述】:

谁能解释为什么我在使用 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-类型 -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 目标-c com.apple。 compilers.gcc.4_0

最后是 GUI + xcodebuild

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

【问题讨论】:

    标签: objective-c xcode macos xcodebuild


    【解决方案1】:

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

    xcodebuild -configuration Release -sdk iphonesimulator3.0
    

    【讨论】:

    • 对不起,我弄错了。添加 -sdk 选项并没有解决问题
    【解决方案2】:

    使用-scheme 指定您要构建的方案。没有它xcodebuild 可能会使用“旧版”target 驱动的构建系统,这是不同的。在重新分配项目时,您可能希望为此共享一些方案。

    参见:xcodebuild driving me nuts again with a zombie OBJROOT 的后记

    【讨论】:

      【解决方案3】:

      您是否安装了多个版本的 XCode?如果是这样,对相关问题的回答可能会解决您的问题:https://stackoverflow.com/a/11129067/567039

      【讨论】:

      • 只安装了一个 XCode 版本
      猜你喜欢
      • 1970-01-01
      • 2016-03-23
      • 2015-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-31
      • 1970-01-01
      相关资源
      最近更新 更多