如何获取使用 Applescript 触发的 Xcode 4 中的构建结果?

发布于 2024-11-28 06:00:10 字数 211 浏览 1 评论 0原文

我正在运行一个运行 Xcode 4 的 Applescript,但无论构建成功还是失败,脚本都会结束。

有什么方法可以等待 Xcode 完成构建并获取结果吗?如果成功,我可以用成功消息结束Applescript,但如果失败,我想获取在Xcode中打印的日志(我在其中获取所有错误和详细信息)并将它们传递给脚本,以便它们可以保存在文件中。

有人可以指出我执行此操作的正确程序吗?

I am running an Applescript that runs Xcode 4, but the script ends no matter what, either if the build is successful or if it fails.

Is there any way that I can wait for Xcode to finish to build and get the result? In case of a success I can just end the Applescript with a success message, but if it fails I would like to get the logs that are printed in Xcode (where I get all the errors and details) and pass them to the script so they can be saved on a file.

Can someone point me to the right procedure to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

轻拂→两袖风尘 2024-12-05 06:00:10

请参阅这个问题以及我的答案,但基本上 Xcode 4 中的构建命令无法正常工作,因为看起来Apple 方面的实施不完整。如果该命令实际上返回了一个值,那么 Applescript 将等待直到收到响应,然后再继续执行下一个命令。

Please see this question along with my answer, but essentially the build command in Xcode 4 does not work properly because of what looks to be an incomplete implementation on Apple's part. If the command actually returned a value, then Applescript would wait until it got a response before moving onto the next command.

叶落知秋 2024-12-05 06:00:10

您查看过 Xcode 的 AppleScript 字典吗?因为当我查看 Xcode 3.2 的字典时,我看到一个名为 build 的命令,它带有一个可选的 transcript 参数。

构建说明符:命令的对象
[静态分析布尔值]:在构建的同时执行静态分析。
[transcript boolean] :如果给出,则在构建完成时应返回完整的构建脚本。否则,将返回一个简单的构建状态。
[使用构建配置类型]:构建时使用的构建配置类型。如果没有给出构建配置类型,则使用活动的构建配置类型。

我没有可以构建的 Xcode 项目来测试这一点,但看来您需要获取要构建的项目,然后调用 set build_results to (build the_projecttranscript true)

即使没有 transcripts 参数,您也应该得到一个构建状态,指示构建是否成功。

Have you looked in the AppleScript dictionary for Xcode? Because when I look at the dictionary for Xcode 3.2, I see a command called build which takes an optional transcript argument.

build specifier : the object for the command
[static analysis boolean] : Perform static analysis along with the build.
[transcript boolean] : If given, then the full build transcript should be returned when the build finishes. Otherwise, a simple build status is returned.
[using build configuration type] : The build configuration type to use when building. If no build configuration type is given the active build configuration type is used.

I don't have an Xcode project that I can build to test this, but it would appear that you need to get the project you want to build and then call set build_results to (build the_project transcript true)

And even without the transcripts argument, you should get a build status back indicating whether the build succeeded.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文