ios Xcode 内的终端窗口?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21998706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Terminal window inside Xcode?
提问by Adam Johns
Does Xcode
have an area I can open up a terminal shell session insideXcode
? Android Studio
has a window you can open up at the bottom by the console logcat
window that will start a terminal session. Does Xcode
have anything like this?
是否Xcode
有一个区域,我可以打开一个终端shell会话内Xcode
?Android Studio
有一个窗口,您可以通过控制台logcat
窗口在底部打开该窗口,该窗口将启动终端会话。是否Xcode
有这样的事?
采纳答案by RaffAl
Unfortunately there is no such a thing in Xcode
. We have to fall back to external Terminal
window.
不幸的是,在Xcode
. 我们必须退回到外部Terminal
窗口。
If you really want to do it, you can add a build phase and run script that opens the Terminal
- but that might not be what you are looking for.
如果你真的想这样做,你可以添加一个构建阶段并运行脚本来打开Terminal
- 但这可能不是你想要的。
回答by Aleksei Minaev
Create executable shell script with the following contents and save it anywhere
#!/bin/bash open -a Terminal "`pwd`"
- Add execute permissions to your script:
$ chmod +x <YourShellScript>
- Add execute permissions to your script:
- In the Xcode menu bar, Go to Xcode -> Preferences -> Behaviors.
- Add a Custom behavior
- Name it "Open Terminal", or whatever.
- (Optional) Configure a hotkey for the behavior by tapping on the ?
- (Optional) Input hotkey combination
- Checkmark Run, select you script from step 1.
- Use it within Xcode.
使用以下内容创建可执行的shell脚本并将其保存在任何地方
#!/bin/bash open -a Terminal "`pwd`"
- 为您的脚本添加执行权限:
$ chmod +x <YourShellScript>
- 为您的脚本添加执行权限:
- 在 Xcode 菜单栏中,转到 Xcode -> Preferences -> Behaviors。
- 添加自定义行为
- 将其命名为“打开终端”或其他名称。
- (可选)通过点击 ?
- (可选)输入热键组合
- 选中运行,从步骤 1 中选择您的脚本。
- 在 Xcode 中使用它。