4
votes

Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?

10
What do you see in the simulator? Do you see the SpringBoard?Espresso

10 Answers

5
votes

I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.

Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.

Okay, so here's the underlying problem, and my solution:

My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.

Here's how to found out: Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:

  1. Debug
  2. Distribution
  3. Release

Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.

3
votes

This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.

2
votes

I skimmed the post and these seem to be the two solutions thus far:

I think I figured out the problem:

I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?

Anyways, the app now boots in the simulator. Yay!

And the other solution in that post is:

Did your project by any chance have a folder reference with images in it?

For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.

This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.

2
votes

Restarting the simulator worked for me

1
votes

I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.

1
votes

I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.

After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.

1
votes

Ensure you are starting a proper scheme.

I. e. when using CocoaPods, running Pods scheme would not start emulator.

0
votes

It's a known issue. Have a look at this thread in the official forum.

0
votes

Hey, update Xcode to 4.0.2. Problem solved :)

0
votes

I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.