BlueShoe
BlueShoe

Reputation: 693

xCode4 won't run app in Simulator

I just downloaded and installed xcode4 with the latest SDK. I opened my project selected run and the simulator pulls up but stays black. All I see in the status window of XCode is 'Attaching to MyProjectName

Upvotes: 3

Views: 5559

Answers (4)

Leon Lopez
Leon Lopez

Reputation: 41

What did the trick for me is:

  • Open the project navigator
  • Click on Build Phases
  • Use the search tool and check if there is result for info.plist. If there is result, remove it.
  • Build and run

Upvotes: 0

James Boutcher
James Boutcher

Reputation: 2613

There are a lot of different solutions people suggest for this:

  • Do a clean
  • Reset simulator
  • Do a 'clean build folder' (hold down option key when selecting clean)
  • Remove ~/Library/Developer Tools/Xcode/Derived Data/YourProject*
  • Remove your 'xcuserdata' directory inside your .xcodeproj directory

I just spent an hour trying different combinations of the items above, doing all of them, ... nothing worked. My app would either 1) Immediately start and quit before launch screen would show up, or 2) Hang at launch screen. The simulator took forever to reset, sometimes wouldn't respond to a Quit, ... Just really odd stuff going on.

This solved my problem: Reboot machine.

(It blows my mind this had to be done on Mac OS, but it worked. This may have something to do with upgrading to XCode 4.6 and not rebooting since then, I'm not sure... But I'm back running again)

Upvotes: 1

Hiedi
Hiedi

Reputation: 256

check out my blog post for how to get around this -- basically you need to delete your xcuserdata for the project. http://hiediutley.com/2011/03/10/xcode4-is-your-old-project-hanging-in-the-simulator/

Upvotes: 10

David Hancock
David Hancock

Reputation: 15001

I've been struggling with this same problem for half a day! Finally I managed to solve my issue.

My applications plist file had been heavily modified, so I created a new application and compared my plist values to the new one. My plist file had a hard coded string set for the Executable file value, changing this solved my issue.

  1. Open up your ApplicationName-Info.plist file
  2. Check the value for Executable file is set to ${EXECUTABLE_NAME}
  3. Clean, Build, Run
  4. Clean, Build, Run again.

I'm not sure why I had to Clean, Build, Run twice, but it failed to launch the first time.

Hopefully this works for you. Try changing some of the other values back to their defaults if this doesn't work as it may still be an issue with your plist file.

Upvotes: 1

Related Questions