Alex Rivera | Logout

Xcode compiles my App, but can't run it in the simulator

Asked 2012-03-14T12:42:47.027
54

when i compile my app, Xcode just says "Attaching to Projectname..." and gets stuck there. The debugger just prints this out:

error: failed to attach to process ID 0

I tried to clean & build again and it still doesn't work out. I googled but couldn't find anything helpful. How can I fix this problem? Thank You!

Edit
Report

4 Answers

11

Have you tried closing down the simulator entirely, or failing that, reset the simulator and all its contents usually does the trick.

answered 2012-03-14T12:45:49.903
2

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
answered 2012-12-13T21:18:24.950
0

try to do next steps:

  • Go to Product/Scheme/Edit Scheme then select Run section.
  • Select Info Tan and set Debugger None.
  • Run project. It must be working (without debugger)
  • Go back to Edit Scheme and selecet debugger LLDB
  • Run project. It is working.

Maybe additionally you need to delete derived data and do Product/Clean

answered 2013-07-30T08:53:58.383
-12

I fixed my problem by I making a new blank project and importing all the old files.

It must have been a problem with Xcode because it worked before iOS 5.1.

answered 2012-03-24T08:55:12.073

Your Answer