文科的格调 + 工科的背景 = 爱浪漫的程序媛

Xcode4 attaching to appname问题解决方法


please note, this is not a sequence of steps. each one is a possible solution:

1- restart xcode and/or restart simulator (reset content and settings) and/or restart computer.

2- click on project name in project navigator. in build settings tab, go to packaging and make sure that “Product Name” is the same that the one xcode says simulator is attaching to when running. if they are different, it will fail.

3- go to your projectname.xcodeproj folder. inside there delete anything named with your userid. when you reopen xcode those files will be recreated and it should work…

4- Manually delete the build directory for your project.

5- Go to organizer window. select Projects, select your app in the left hand side and then delete over “Derived Data”

6- Check Launch option is set to “Automatically” in Product->Edit Scheme, “Run” scheme.

7- In Project->”Edit Schemes”->Run. Change the Debugger from GDB to None (this doesn’t make sense to me..).

8- Kill the process gdb-i386-apple-darwin from Activity Monitor. this is assuming gdb is not responding.

9- In “Product”->Edit Scheme. in Run, click yourappname.app, choose other, navigate to your .app in your project. now run.

10- Check that you don’t have two different Info.plist in your project. if you do, remove the bad one.







Why does the LLDB Debugger constantly fail to attach?

This doesn’t mean you need an internet connection in order to debug, as is the loopback interface (Google that for details) and it’s simply that lldb (and gdb) uses TCP for its interprocess communication mechanism.

LLDB attaching to app其实是在跟这个进程通信,中间需要用localhost映射到本机地址127.0.0.1进行回调,我们常常为了各种原因修改hosts文件,LLDB在hosts文件中找不到映射,也就会一直保持在这个步骤,没办法跟进程通信了,就卡住了。所以,只要保证localhost映射到127.0.0.1问题就解决了。


  1. Sillvester说道:



电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.