本文介绍了告诉 AppleScript 构建 XCode 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我想要的步骤:

  1. 启动 xcode
  2. 打开一个特定的 xcodeproj 文件
  3. 构建和调试它
  4. 退出 xcode

以下是我第一次尝试编写 AppleScript:

The following is my first attempt to write AppleScript:

tell application "Xcode"
    tell project "iphone_manual_client"
        debug
    end tell
    close project "iphone_manual_client"
end tell

这仅在 xcode 打开此项目时有效.我希望只有在必要时才打开该项目.

This only works when xcode has this project opened. I would like to have the project to be opened only when it is necessary to do so.

任何 AppleScript 专家都可以指出我正确的方向吗?谢谢.

Can any AppleScript gurus out there points me to the right direction? Thanks.

-川-

推荐答案

我想我已经解决了.以下是 AppleScript:

I think I managed to solve it. The following is the AppleScript:

tell application "Xcode"
    open "Users:chuan:Desktop:iphone_manual_client:iphone_manual_client.xcodeproj"
    tell project "iphone_manual_client"
            clean
            build
            (* for some reasons, debug will hang even the debug process has completed.
               The try block is created to suppress the AppleEvent timeout error
             *)
            try
                debug
            end try
    end tell
    quit
end tell

路径的格式必须是:"而不是/".现在唯一的问题是,在调试控制台完成其工作后,AppleScript 似乎挂起",好像在等待某事发生.我需要对 AppleScript 进行更多研究,以了解脚本有什么问题.

The path has to be in format of ":" instead of "/". The only problem now is that after the debug console has done its job, AppleScript seems to "hang" as though waiting for something to happen. I need to do more research on AppleScript to know what is wrong with the script.

这篇关于告诉 AppleScript 构建 XCode 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 07:35