我刚刚升级到Xcode 4,由于某种原因,我的应用程序无法在模拟器或iOS设备上运行。它在Xcode 3中工作得很完美,但现在当我按下运行时,程序突然停在“附加到…”似乎也没有任何其他信息可以帮助解决这个问题。

总的来说,你可以尝试以下方法来解决这个问题:

重新启动模拟器。 确保你没有包含信息。plist文件在你的构建阶段->复制捆绑资源。 Resources文件夹作为文件夹引用添加到项目中(蓝色文件夹图标)。这导致了问题,在将文件夹作为一个组添加后,问题就消失了。


当前回答

I was having this very annoying issue since a long time too. I've 3 different XCode versions installed and I'm not sure whether it's the reason or not that none of the above solutions worked for me. But here is the solution I finally found: I don't kill the running Simulator, I just try to launch it again using a Spotlight search, enter "Simu" and you should find it in Applications, then hit Enter. As it's yet running it will magically start my app that was frozen/locked/waiting for attachment. It works perfectly for me now and I hope it will also work for some (all?) of you.

顺便说一句,我用Cmd+空格来调用Spotlight,这样就可以非常快速地解冻模拟器而不使用鼠标。

其他回答

创建一个新用户帐户,切换到帐户,打开XCode并尝试运行项目。在尝试了所有其他建议都没有成功之后,我不仅再次能够在sim上运行,而且原来的帐户现在也可以工作了。

另外:确保你没有包含信息。在您的构建阶段的plst文件->复制捆绑资源。如果是的话,把它从列表中删除!我可能会发生的小错误,但会把事情搞得很糟糕:S

只是遇到了同样的问题:重新启动模拟器和Xcode不适合我,而重新启动我的mac却很好!

以下是我在4.3.3版本中使用的方法:

在XCode中删除派生数据文件夹。无明显不良影响。

打开Finder,打开文件夹-> ~/Library/Developer/Xcode/DerivedData/ (Shift-Command-G)。

希望这能帮助那些尝试过其他方法的人……

Xcode 12.5破坏了我对iMessage应用程序的调试。我仍然可以调试主应用程序,但当我激活iMessage应用程序的方案时,Xcode挂起并连接到该应用程序。降级到Xcode 12.4恢复了我调试iMessage应用程序的能力。