2

I've exhausted probably all possible solutions on how to fix this :

enter image description here

How do I fix this? I need to run unit tests smoothly.

Any advice appreciated. Thanks!

Community
  • 1
  • 1
Kyle Emmanuel
  • 2,193
  • 1
  • 15
  • 22
  • How long did you wait? Sometimes it just takes a long time to attach (it annoys me too). Does it work on the actual device? This question is very weak on its contextual information. – borrrden Jul 16 '13 at 00:59
  • Do you know if it's your app, or XCode? Try saving everything, closing and re-opening XCode. Check your Activity Monitor to see whats happening in XCode in regards to your actual computer. Something similar happened to me, and I just restarted XCode. What solutions have you tried? – CaptJak Jul 16 '13 at 01:04
  • Are you running Xcode 4.6.3? – rob mayoff Jul 16 '13 at 01:11
  • @CaptJak I've tried most, like reset simulator, delete derived data, check if appname-info.plist was not in the "copy bundle resources", etc. – Kyle Emmanuel Jul 16 '13 at 01:11
  • @robmayoff Yes. I've updated it yesterday but to no avail did the update fix it for me. any tips? – Kyle Emmanuel Jul 16 '13 at 01:12
  • @borrrden A long time did i wait but to no avail. – Kyle Emmanuel Jul 16 '13 at 01:12
  • Do you know if it's your app? or XCode? or your computer? – CaptJak Jul 16 '13 at 01:16
  • @CaptJak I don't really know who the culprit is. – Kyle Emmanuel Jul 16 '13 at 01:18
  • There you go. Find the culprit, find your problem. Have you tried computer handling? Check your activity monitor (on your computer) and see whats going on while it hangs up at "attaching" – CaptJak Jul 16 '13 at 01:20
  • Does it happen with all projects, or only tests? – Can Jul 16 '13 at 01:32
  • @Can It happens with all projects. – Kyle Emmanuel Jul 16 '13 at 01:41
  • I had a similar issue when I commented out the hosts file, where it points localhost to 127.0.0.1, because XCode runs it by network, have you messed with the hosts file recently? – Can Jul 16 '13 at 01:47
  • 1
    Reboot your computer, or edit your answer to provide a full list of everything you have tried WITH DETAILS. This entire comment section is becoming a Q&A for "what have you done". Tell us everything you tried so we can help you faster. – CaptJak Jul 16 '13 at 01:47
  • Reboot your box. The Mac runs out of process handles and can't start the emulator processes. There is also a process that gets hung and won't die and won't let the emulator start. You can kill if you know how to find it, but I can't tell you without having the problem in front of me. – Hot Licks Jul 16 '13 at 02:03
  • @Can hosts file is already normal. 127.0.0.1 already maps to localhost. – Kyle Emmanuel Jul 16 '13 at 06:09
  • @CaptJak I've done what was stated in other posts related to the issue. no avail still. – Kyle Emmanuel Jul 16 '13 at 06:10
  • @HotLicks yes, but still no avail. – Kyle Emmanuel Jul 17 '13 at 00:59
  • You've probably already tried this, but -- http://stackoverflow.com/a/16840401/581994 – Hot Licks Jul 17 '13 at 01:08
  • And what about this one: http://stackoverflow.com/a/17102268/581994 – Hot Licks Jul 17 '13 at 01:09

2 Answers2

3

Quick solution for this problem:

In finder press SHIFT+CMD+G and type

   ~/Library/Developer/Xcode/DerivedData

enter image description here

This opens DerivedData folder, delete all folder inside DerivedData.

Also Reset simulator's content:

         ~/Library/Application Support/iPhone Simulator/6.0/Applications  
Guru
  • 21,652
  • 10
  • 63
  • 102
1

Press simulator icon at dock (or edit your scheme actually to "run app" not waiting for launch.)

Maybe this was fixed in latest xcode( pressing icon to resolve attaching issue), but in a bit outdated xcode this issue exists.

Edit: another solution which helped in the past:

Project > Edit Schemes Change debugger.

Eugene Pinchuk
  • 546
  • 3
  • 14