Sublime Forum

Xcode and Sublime Text 2

#1

Hello,

I would like to know if any of you are using Sublime Text 2 to work along with Xcode on Cocoa projects? I am not trying to duplicate functionality from Xcode, but rather use a single editor for all my needs, as I often have to switch between Xcode and ST2.

So, what are your settings, how does your .sublime-build command looks like?
Thanks!

Best,
Camile

0 Likes

#2

I would also really like to know this. I’m replacing XCode with Sublime as my primary Mac OS editor but I’m having lots of difficulty getting basic things to work cleanly. Is there a package to read XCode 4 workspaces? How about XCode projects? GDB + iOS simulator? xcodebuild?

I would really appreciate any help that could be provided

0 Likes

#3

If you look at AppCode, which is Jetbrains ObjectiveC IDE (jetbrains.com/objc/) - they provide all the CODE based editing and debugging tools, however it still launches XCode when it comes to features like Interface Builder/Storyboard. So something similar may be possible using the command line tools for compilation/debugging

0 Likes

#4

I just got this working, so I figured I’d share.

I installed SublimeClang and with the help of quarnster (thanks a million!), got that up and running with my project. Then I followed these instructions to get sublime to build and run via iOS simulator from the command line: cocoamanifest.net/articles/2011/ … -line.html

Finally, I set the following build script: [pre=#2A2A2A]{
“cmd”: “xcode-build.sh”, “$file_base_name” ],
“file_regex”: “^(…^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${project_path:${folder}}”,
“selector”: “source.m”
}[/pre]

This build script calls the script given in the cocoamanifest article which I saved in my path. Now I have a light, full-featured IDE that essentially replaces Xcode.

0 Likes

#5

@cod312
I tried the solution but sublime look for the code where the build script directory and no method I’ve tried to direct it to the
The right directory where the code.
Any method that I can use to fix it.
Thank you!

Elik

0 Likes

#6

xcode-build.sh is saved to /usr/bin/

The build script is saved in the Objective-C folder in the ST Packages folder.

Make sure your project is saved as an sublime text project.

0 Likes

#7

I believe i’ve followed the directions exactly.

Getting a permissions denied issue.

[Errno 13] Permission denied
[cmd: [u’xcode-build.sh’, u’AppDelegate’]]
[dir: /Users/Charles/Documents/sublimeText2]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

Any ideas? Would LOVE to get this working.

0 Likes

#8

Well, is the script executable?

sudo chmod +x /usr/bin/xcode-build.sh
0 Likes

#9

Nothing is impossible. It is a little tough. I have been using Xcode since 3 years and sublime for 2 years. The latest version of Xcode 8 has a C++ to C compiler, C# to C, Python to C and many more. You save your ST2/ST3 file and import to Xcode. And then you will have an option to convert to C and your work is done

0 Likes