Xcode 4.2. gets stuck “Attaching to myapp” when running

后端 未结 12 1792
梦毁少年i
梦毁少年i 2021-01-31 19:40

In xcode 4.2, sometimes when you\'re going to run your ios proj on simulator, the status windows says \"Attaching to myapp\", and just gets stuck there... until you cancel. Now,

相关标签:
12条回答
  • 2021-01-31 20:11

    Did you recently upgrade to OSX 10.7.2? I started having the same problem after I upgraded. I noticed that the Simulator always get stuck if I'm connected to a Wi-Fi network that forces Captive Portal authentication. This happens with other apps as well (Chrome, Safari). I'm not really sure why this happens, but I did read that 10.7.2 has issues with Captive Portal authentication.

    Anyway, in my case, I repaired disk permission from Disk Utility and rebooted my machine. This seems to resolve the issue.

    0 讨论(0)
  • 2021-01-31 20:11

    It seems different in my case and also solved in a different way. If you got stuck every time after drop some files or folders into your project with the 'Create folder references for any added folders' way, this will be the solution.

    Click the project node(the root node) on Xcode's project navigator and select target node. It's under the 'TARGETS'. Then click the 'Build Phases' tab. There are 4 sections of some list and you can click the triangle to expand the list. You need to concentrate on the 'Compile Sources' and 'Copy Bundle Resources' section. Code files like .m must be placed on the 'Compile Sources' section and are compiled automatically. Resource files like .jpg must be placed on the 'Copy Bundle Resources' section and are copied into the project's package. So, if the dropped files and folders are not in the 'Copy Bundle Resources' list, just drag it form the project navigator and drop onto the list. That will solve the problem.

    If it doesn't work, delete all the referenced files and folders, click '+' button on the resource (or compile) section and click 'Add other...' button. Then you can include files and folders as the 'Create folder references for any added folders' way. I think the 'drag and drop' works well after the '+ button' way is done once.

    In addition, 'Resource' may not allowed for folder name.

    I experienced the 'stuck' problem every time when I attach files and folders as reference on Xcode 4.2 ~ 4.3.3. Reinstalling mac was a useless effort for me.

    0 讨论(0)
  • 2021-01-31 20:15

    New projects were failing to launch in the simulator, getting stuck on the attach step.

    This seems to be after Xcode 4.3 was installed, but I can't recall the last new project I created.

    This is what worked for me, the clue coming from this thread...

    Project->"Edit Schemes"->Run. Change the Debugger from LLDB to GDB

    Another computer with the same version of Xcode works fine. Maybe my LLDB is corrupt?

    0 讨论(0)
  • 2021-01-31 20:17

    I tried all of the solutions above but without luck ... When I search for simular problem here : Xcode error: failed to launch [directory] -- invalid host string: 'localhost'

    I found it fixed my problem! Hope this helps those who are still searching for a clue .

    0 讨论(0)
  • 2021-01-31 20:21

    Just rebooting the computer worked for me.

    0 讨论(0)
  • 2021-01-31 20:22

    seems like there seem to be a lot of things causing this, but one thing that worked for me was simply cleaning out the build folder by pressing Cmd+Option+Shift+K or alternately if you select the Product dropdown in the toolbar and hold the Option button you should see the "Clean Build Folder" option appear

    0 讨论(0)
提交回复
热议问题