2

I can't run my app on the iPhone simulator. Xcode 5.0 shows that it is currently "Attaching to [MyApp]" and will be stuck in this.

Previously in Xcode 4.2 I can change the debugger to GDB and it works, but in Xcode 5.0 there is only LLDB.

Anyone managed to solve this problem?

Scott
  • 773
  • 1
  • 6
  • 18

5 Answers5

3

Make sure you have localhost mapped to 127.0.0.1 in your /etc/hosts file. As suggested by trojanfoe's link Why does the LLDB Debugger constantly fail to attach?.

Community
  • 1
  • 1
Scott
  • 773
  • 1
  • 6
  • 18
  • wow - thanks for this. I've been wasting hours trying to figure out why xcode wouldnt suddenly attach. More worrying is why is my hosts file suddenly empty – Zayin Krige Mar 06 '14 at 13:56
1

Just quit the Xcode. Reset your simulator content and settings.

Clean and build your project again and you are ready to go.

Edited

  • delete the Derived Data in the Organizer under Projects or directly in ~/Library/Developer/Xcode/DerivedData

  • clean the Build Folder by choosing "Product" in the MenuBar and click while you press the Alt-key on "Clean Build Folder"

  • Restart Xcode

Then delete the app from your simulator if it is. Reset your simulator's content and settings.

Now clean and build your project. It should work fine.

Manthan
  • 3,856
  • 1
  • 27
  • 58
0

Close Xcode and the simulator and retry

vin
  • 1,258
  • 5
  • 20
  • 33
  • Closing and killing are different things. When my xcode has this it needs to be killed, quit is not honoured. – RickJansen Dec 08 '13 at 17:14
0

I have observed this behavior mostly when during debugging the app is running and I stop the debugging using short-cut Cmd + . and repeat this activity several times.

In order to fix it you can force close Xcode from the Finder (or sit and wait to close once available) and just restart Xcode. Note that iPhone simulator should not be using your app in the meanwhile (if it is the case, press Home button of simulator)

I think there is no need to use simulator's Rest Content and Setting... feature.

Hope it helps!

NeverHopeless
  • 11,077
  • 4
  • 35
  • 56
0

If you need to kill Xcode to "solve" this it is a bug in Xcode. File a bug at Apple: https://bugreport.apple.com

RickJansen
  • 1,615
  • 18
  • 24