Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 263
Jumhyn Avatar asked Dec 12 '22 15:12

Jumhyn


2 Answers

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.

like image 59
davethewave Avatar answered Dec 26 '22 20:12

davethewave


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.

like image 31
Jonathan. Avatar answered Dec 26 '22 20:12

Jonathan.