Xcode Customizing Xcode IDE


This is collection of different tips and tricks, to customize and improve your Xcode IDE

Open Terminal in current Xcode project folder

Xcode have ability to run any script with hotkey.

Here is example how to assign hotkey ⌘+⌥+⌃+⇧+T to open Terminal app in current project folder.

  1. Create bash script and save it in some folder

# Project Name:  $XcodeProject
# Project Dir:   $XcodeProjectPath
# Workspace Dir: $XcodeWorkspacePath

open -a Terminal "$(dirname $XcodeProjectPath)"  
  1. Make script executable: open Terminal at script folder and run chmod +x your_script_name.sh

  2. Open Xcode Preferences at Behaviors tab

  3. Add new custom behavior by tapping + in the bottom left corner

  4. Check Run action at the right enter image description here

  5. Choose script, which you create previously by clicking at the Choose Script... twice.

If your script is grayed, be sure, that you run chmod +x on your script file enter image description here

  1. Assign hotkey (for example ⌘+⌥+⌃+⇧+T) to your behavior and rename it enter image description here

Now you can open terminal in project folder with one hotkey.

This is only one example of using Xcode behaviors, but you can create any script and launch any app with it.

Bash script author: http://mattorb.com/xcode-behaviors-for-fun-and-profit/

Clear derived data with hotkey

In the same way as in Open Terminal in current Xcode project folder example, you can add clear of derived data folder with hotkey.

Create custom behavior (follow the steps in Open Terminal in current Xcode project folder). But use another script.

Script text:


rm -rf $HOME"/Library/Developer/Xcode/DerivedData/"