views:

461

answers:

3

Hi, I've written an iPhone app and only tested it with the simulator as I don't have an actual iPhone. If I Build and Go, I can see the app running. But if I go to Finder and then open it through the project's build folder, it just crashes immediately. Does anyone know the reason for this?

+2  A: 

Finder won't launch the simulator correctly. XCode is the only supported way to launch the simulator as far as I know.

John Fricker
+7  A: 

It crashes because double-clicking it causes Mac OS X to try and run it as a Mac app. It's got the same structure as a Mac app, and it's an x86 binary, so why not? But the iPhone app tries to dynamically link UIKit, fails to do so, and crashes. The simulator sets up the iPhone app's environment so that the linking succeeds. You could probably do this at the command line with careful use of environment variables, but the Finder doesn't do so.

Tom Harrington
+1  A: 

So Tom, if I wanted to send that binary to a friend, what are the instructions for opening it?

Simulator apps are stored in ~/Library/Application Support/iPhone Simulator/User/Applications/ in a directory with a UUID name and a file named $UUID.sb. Find the right dir and file, send them, and have your friend put them in that Applications directory on his Mac.
Tom Harrington