when i compile my app, Xcode just says \"Attaching to Projectname...\" and gets stuck there. The debugger just prints this out:
error: failed to attac
I had similar issues when i installed XCode 4.5 on OS X Mountain Lion. I searched a while and tried some fixes but what finally solved the problem was adding "127.0.0.1 localhost" to my hosts file (/etc/hosts).
Here is what i have done:
Open a terminal shell with cmd+space > terminal
type in "cd /etc"
type in "sudo nano hosts"
type in your root password
add "127.0.0.1 localhost"
save with ctrl+o > return
close with ctrl+x
log out and log in again or restart
try to do next steps:
Maybe additionally you need to delete derived data and do Product/Clean
Make sure you do not have an invalid build rule, that will cause this error, happened to me once (I had added a build rule by mistake and left it invalid).
Also make sure none of your file/group name collide with the projects default settings.
Things started breaking for me when I added an info.plist file to my project (Bad Idea). Same happens when you add a "Resource" Group. I don't have an exhaustive list, but if someone does please do share.
Cleaning out / Renaming these conflicting files and following the solution provided by Lindemann(https://stackoverflow.com/a/12504712/2069749) solved the problem for me.
The solution for me was to delete everything Xcode has generated earlier:
~/Library/Application Support/iPhoneSimulator/6.0/Applications
~/Library/Developer/Xcode/DerivedData
If you are using a network account, you should replace the "~/Library/Application Support/iPhone Simulator
" with a link to a local directory. This worked for me after trying everything else.