Adam Johns
Adam Johns

Reputation: 36343

Terminal window inside Xcode?

Does Xcode have an area I can open up a terminal shell session inside Xcode? 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?

Upvotes: 113

Views: 133007

Answers (3)

mackworth
mackworth

Reputation: 5953

Relatedly, now in Xcode 8, you can have your program run automatically in Terminal rather than using the Xcode Console. Just go to Edit Scheme > Run > Options and set Console at the bottom to Terminal.

And here's the Xcode 15.0 pulldown version: Xcode 15 pulldown:

Upvotes: 6

Aleksei Minaev
Aleksei Minaev

Reputation: 1568

  1. 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>
  2. In the Xcode menu bar, Go to Xcode -> Preferences -> Behaviors.
  3. Add a Custom behavior
  4. Name it "Open Terminal", or whatever.
  5. (Optional) Configure a hotkey for the behavior by tapping on the
  6. (Optional) Input hotkey combination
  7. Checkmark Run, select you script from step 1.
  8. Use it within Xcode.

Image with numbers corresponding to steps

Upvotes: 89

Rafał Sroka
Rafał Sroka

Reputation: 40030

Unfortunately there is no such a thing in Xcode. We have to fall back to external Terminal window.

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.

enter image description here

Upvotes: 59

Related Questions