# Open your terminal from Xcode

Xcode is one of the few IDE's I know that does not have a "Open terminal" button. But you can leverage so called "Xcode Behaviors" to quickly launch your terminal.

Xcode Behaviors allows you to execute shell scripts from Xcode with a keyboard shortcut.

There is a nice selection of useful scripts on GitHub and the repo of [Awesome-Xcode-Behaviors](https://github.com/JeaSungLEE/Awesome-Xcode-Behaviors) explains well on how to setup Xcode Behaviors with these scripts.

%[https://github.com/JeaSungLEE/Awesome-Xcode-Behaviors]

I use [iTerm2](https://iterm2.com/) as a replacement for Terminal so I can use the [open-iterm.sh](https://raw.githubusercontent.com/JeaSungLEE/Awesome-Xcode-Behaviors/master/Open%20Application/open-iterm.sh) script that I downloaded from GitHub.

**UPDATE November 2022**: I recommend using a different script that is optimized and works well for Xcode projects/workspaces as well as Swift Packages. I share `open-iterm-from-xcode` as a gist with you.

%[https://gist.github.com/MarcoEidinger/50bbd42a42d3c698193167b55a343c1c]

You need to make the script executable. Use `chmod +x open-iterm-from-xcode` in your terminal.

![Setup iTerm in Xcode Behaviors](https://cdn.hashnode.com/res/hashnode/image/upload/v1657300983387/RDkVCxwhz.png align="left")

![Launch a Xcode behavior](https://cdn.hashnode.com/res/hashnode/image/upload/v1657301006637/JnndY7ZdF.png align="left")

With a custom shortcut I can easily open the terminal now.

![Large GIF (1302x974).gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1657301790943/bdoBHnzC3.gif align="left")

Xcode behaviors can be further used to speed up your workflow, e.g. 
- Open the Issue Navigator for build failures
- Open the Test Navigator for test failures
- Start debugging in a new tab

If you are interested in more information, then read [Speed up things with Xcode behaviors](https://www.avanderlee.com/xcode/xcode-behaviours-optimized/) by Antoine van der Lee. 
