使用xcodebuild与iOS项目和iOS模拟器

前端之家收集整理的这篇文章主要介绍了使用xcodebuild与iOS项目和iOS模拟器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
question是相关的,但没有解决我遇到的具体问题.

我在OS X 10.7.5下使用Xcode 4.6.3.

我只是为单个视图iOS应用程序创建了默认项目,并且没有对项目设置进行任何更改.当然,该项目使用Xcode为iOS模拟器构建.但是,当我尝试从命令行使用xcodebuild时,xcodebuild失败.

项目名称只是:temp

我试过了:

xcodebuild -scheme temp -sdk iphonesimulator6.1

这产生了结果:

Build settings from command line:
    SDKROOT = iphonesimulator6.1

=== BUILD NATIVE TARGET temp OF PROJECT temp WITH CONFIGURATION Debug ===
Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES,active arch=x86_64,VALID_ARCHS=i386).


** BUILD Failed **


The following build commands Failed:
    Check dependencies
(1 failure)

基于其他SO问题,我试过:

xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -scheme temp -sdk iphonesimulator6.1

得到了类似的结果:

Build settings from command line:
    ARCHS = armv7 armv7s
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator6.1

=== BUILD NATIVE TARGET temp OF PROJECT temp WITH CONFIGURATION Debug ===
Check dependencies
No architectures to compile for (ARCHS=armv7 armv7s,VALID_ARCHS=i386).


** BUILD Failed **


The following build commands Failed:
    Check dependencies
(1 failure)

我需要执行什么xcodebuild命令才能使用xcodebuild构建?

谢谢.

解决方法

更新:
好像许多人在xcode 4中遇到这种麻烦,一般的解决方案似乎是强制你需要的架构并禁用’仅活动’,这是你试过的…但对于模拟器,你需要指定i386而不是arm *,如下所示:

xcodebuild ARCHS="i386" ONLY_ACTIVE_ARCH=NO -scheme temp -sdk iphonesimulator6.1

* ORIGINAL响应产生了下面的评论帖子,仍然有一些有价值的参考:
这听起来像你的项目我没有为64位设置.您应该能够在构建设置中将arm64添加到有效的体系结构中,我相信xcode会自动将其视为x86_64用于模拟器构建.

对于您尝试的第二件事,您正在将您的架构硬编码到IPhone架构,同时瞄准模拟器,我相信这就是为什么架构不可用.

猜你在找的Xcode相关文章