Debug Mac OS X code built from terminal

This is just for reference: If you create a Mac app from the terminal but would like to debug it using xcode, do like this:
1. Create an empty project
2. Create a new scheme
3. In run/debug set exe to your handmade app
4. add source to the empty project (drag and drop)
5. set breakpoints as per usual
6. debug!

Example:
https://github.com/framkant/osx_handmade_hybrid

Just download and run the build.sh script from a terminal
then:
run app: open build/Handmade.app
debug: open osx_support_files/DebugHandmadeHybrid/DebugHandmadeHybrid.xcodeproj

N.B: there is a problem with relative paths in xcschmes so I wrote a script to create the Debug xccheme from the build script (makexcscheme.sh)