Jumhyn
Jumhyn

Reputation: 6777

Xcode 4 not launching application?

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?

Upvotes: 4

Views: 10846

Answers (10)

Cfr
Cfr

Reputation: 5133

Ensure you are starting a proper scheme.

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

Upvotes: 1

Luda
Luda

Reputation: 7078

Restarting the simulator worked for me

Upvotes: 0

Egil Rausner
Egil Rausner

Reputation: 381

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.

Upvotes: 1

Abdul
Abdul

Reputation: 11

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

Upvotes: 1

nonamelive
nonamelive

Reputation: 6510

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

Upvotes: 0

mruffa
mruffa

Reputation: 21

Hey, update Xcode to 4.0.2. Problem solved :)

Upvotes: 0

davethewave
davethewave

Reputation: 51

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.

Upvotes: 5

Jonathan.
Jonathan.

Reputation: 55594

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.

Upvotes: 3

Roosh
Roosh

Reputation: 97

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.

Upvotes: 2

nicktmro
nicktmro

Reputation: 2288

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

Upvotes: 0

Related Questions