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

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

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


当前回答

在Product > Edit Scheme > Run > Info下,将调试器从LLDB更改为GDB,对我来说非常完美!

其他回答

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,这样就可以非常快速地解冻模拟器而不使用鼠标。

我也有同样的问题。问题是有另外一个用户登录并运行了模拟器。假设对于不同的用户,一台机器上只能运行一个iphone模拟器实例。希望这个信息对某些人有用:)

当网络链接调节器处于活动状态时,Xcode无法连接。尝试在连接完成后激活它。

这似乎也发生在我的信息。Plist文件处于复制构建阶段。有时Xcode会警告你,有时则不会。很奇怪。但如果你遇到了这个问题,请确保信息。plist不在副本构建阶段。

这个解决方案不是技术性的,但对我来说很有效。

当attach to Process出现在xcode中并挂起一段时间时,就像iOS模拟器一样,按Command + R重新启动应用程序。

它将启动应用程序没有任何问题:)