Last Updated: December 26, 2018
·
8.971K
· plukevdh

Build Xcode projects in Sublime Text 2

I dunno about you, but I hate Xcode. Sublime Text 2 gets it done for all my editing needs for just about any language I use. What's even more exciting is it has a really flexible build tools integration system so that you can define how a specific project gets built. So no more Xcode is needed!

{
  "folders":
  [{
    "path": "/Users/hungerandthirst/Code/Projects/crunchy/screenshare/ScreenShareOSXClient"
  }],
  "build_systems": [{
    "name": "Crunched",
    "working_dir": "${project_path:${folder}}",
    "cmd": ["xcodebuild", "-project", "Crunched.xcodeproj"]
  }]
}

This is a .sublime-project file. Sublime ships with a default Objective-C built system, which I believes does basically the same thing here. I just needed to have the specific project and build dir set because we have multiple build projects with an odd project directory structure. You could also define a more generic builder by creating a .sublime-build file in the base Packages dir for Sublime Text 2.

In any case, you can go to the Tools > Build System menu and select "Crunched" or whatever your name setting is set to.

Then Cmd-B and watch it run!