如何获取使用 Applescript 触发的 Xcode 4 中的构建结果?
我正在运行一个运行 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅这个问题以及我的答案,但基本上 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.
您查看过 Xcode 的 AppleScript 字典吗?因为当我查看 Xcode 3.2 的字典时,我看到一个名为
build
的命令,它带有一个可选的transcript
参数。我没有可以构建的 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 optionaltranscript
argument.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.