使用Xcode的命令行构建工具(xcodebuild archive)存档 [英] Archive with Xcode's command line build tool (xcodebuild archive)

查看:643
本文介绍了使用Xcode的命令行构建工具(xcodebuild archive)存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于构建Xcode项目的命令行工具xcodebuild在Xcode 4中提供了一个新的构建动作: archive



man xcodebuild

 构建根(SYMROOT)。这需要指定
一个工作空间和方案。

不幸的是,当我尝试使用它时,我得到一个错误:



$ xcodebuild archive -workspace SimpleTestApp.xcworkspace -scheme SimpleTestApp
xcodebuild:错误:无法构建工作区SimpleTestApp与SimpleTestApp方案。
原因:所选的运行目标对此操作无效。

我的印象是这实际上还没有工作。有人有它的工作吗?如果是,如何?

解决方案

有关信息,我99%确定 xcodebuild archive 在以前的Xcode 4版本,也许一个 Beta ...
这是真的令人沮丧,因为 -verbose 和syslogs没有多少细节。



所以我会称之为...一个Bug!



如果自动化你的构建是你正在寻找,有一种方法使用 xcrun PackageApplication

从命令行生成IPA档案



$ c> xcrun 到包和 xcodebuild 来构建,你几乎可以实现 xcodebuild archive 应该做的。我宁愿使用 xcodebuild ,因为我们可以期望这生成 .xcarchive 。 app + .dSYM ),比IPA更有趣。



如果有人知道如何从xcodebuild和Xcode获取更多日志,我真的很感兴趣。



EDIT
在查看
在苹果论坛,我确认这是一个Xcode BUG介绍GM2 ...我猜苹果Xcode工程师工作在Xcode 4.1,我认为最终版本将与OSX Lion ...发布... 6月也许?有修复? :(


The command line tool to build Xcode projects, xcodebuild, has a new build action available in Xcode 4: archive.

From man xcodebuild:

       archive     Archive a scheme from the build root (SYMROOT).  This requires specifying
                   a workspace and scheme.

Unfortunately, when I try to use it I get an error:

$ xcodebuild archive -workspace SimpleTestApp.xcworkspace -scheme SimpleTestApp
xcodebuild: error: Failed to build workspace SimpleTestApp with scheme SimpleTestApp.
    Reason: The selected run destination is not valid for this action.

My impression is this doesn't actually work yet. Has anyone got it to work? If so, how?

解决方案

For information I'm 99% sure that xcodebuild archive was working in a previous Xcode 4 version, maybe a Beta... And this is really frustrating since -verbose and syslogs doesn't bring much details.

So I would call that... a Bug!

If automating your build is what you are looking for, there is a way to generate IPA archive from command line using xcrun PackageApplication

With xcrun to package and xcodebuild to build, you can almost achieve what xcodebuild archive is supposed to do. I would prefer to use xcodebuild since we can expect this to generate a .xcarchive (.app + .dSYM), more interesting than an IPA.

Not so off-topic, but if anyone knows how to get more logs from xcodebuild and Xcode, I'm really interested!

EDIT: After looking in Apple Forums, I confirm this is an Xcode BUG introduced with GM2... I guess Apple Xcode engineers are working on Xcode 4.1 that I think final version will be released with OSX Lion... In june maybe? With a fix? :(

这篇关于使用Xcode的命令行构建工具(xcodebuild archive)存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆