以x code自动调试时打开终端? [英] Automatically open terminal when debugging in Xcode?

查看:474
本文介绍了以x code自动调试时打开终端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试中X code。将可执行文件,我经常要打开一个终端窗口,浏览到可执行文件的工作目录和做一些工作在那里。有什么办法让X code自动在这个位置上的每个调试我的程序时,打开一个终端窗口?

When debugging an executable in Xcode, I very often have to open up a terminal window, navigate to the executable's working directory and do some work there. Is there any way to have Xcode automatically open a terminal window at this location each time I debug my program?

推荐答案

在X code,转到您的目标,然后右键单击并选择:

In Xcode, go to your Target, then right-click and choose:

新增 - >新建设阶段 - >新的运行脚本生成阶段

然后添加以下内容:

open /Applications/Utilities/Terminal.app

现在,每次你建立你的应用程序,X code将执行此构建脚本并启动终端。请注意,您需要指向终端应用的正确位置。要做到这一点最好的办法是找到Terminal.app和拖放到屏幕上方后键入开放。

Now, every time you Build your app, Xcode will run this build script and launch Terminal. Note that you need to point to the correct location of the terminal application. Best way to do this is find the Terminal.app and drag and drop it onto the above screen after you type "open".

一旦你打开终端,你需要做一个AppleScript的命令发送到终端,打开特定的目录。使用osascript命令
发送的AppleEvent到终端。

Once you have Terminal open, you will need to make an AppleScript to send the commands to Terminal to open the specific directory. Use the 'osascript' command to send an AppleEvent to Terminal.

这篇关于以x code自动调试时打开终端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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