I found an excellent article that helped me set up my mac for AVR development (assoc.tumblr.com/post/4641357963 ... ng-on-os-x).
Instead of using Xcode, I just use emacs to edit my C files and run make in that project directory to generate a .hex file. I can then open that .hex file in MacSim.
Xcode changes all the time and I think it is not the best editor for writing and running C Code. When Xcode refers to ‘running’ or ‘building’ it is usually within the context of an .xcodeproj, which in your case would probably be a new ‘Command Line’ Project. If not, how are you opening the file in Xcode?
For what it’s worth there could be an issue with your AVR environment. I use homebrew and used this formula github.com/larsimmisch/homebrew-avr. Homebrew is my favorite package manager for installing command-line tools.
I typed the following into the command line:
sudo brew update
sudo brew tap larsimmisch/avr
sudo brew install avr-libc (this may take a while)
sudo brew untap larsimmisch/avr