tags:

views:

3313

answers:

1

Is it possible to open an iPhone application or an Xcode project from the terminal? I have already tried:

open /path/to/project.app

But this returns a warning and quits unexpectedly due to an image load error when it launches the simulator. Does anyone have any suggestions?

+2  A: 

You cannot launch an iPhone application from the terminal. When you build your Xcode project, part of what it does is "install" the application to the iPhone simulator, like in a real environment. For instance, if you delete your Xcode project and all the files and then run the simulator, you will still find your application there. It's designed to emulate the real environment as much as possible. You can, however, use xcodebuild from the terminal to build and update your project file, then run the simulator application yourself.

For regular, Mac OS X application, you can run these from the terminal, but you have to keep in mind that project.app is just a directory wrapper that the Finder pretends is a single-file application for the user. Your actual executable is located at /path/to/project.app/Contents/MacOS/project. So, for example, if I have a project which generates the application Foo.app, I would launch it from the terminal as such:

$ /path/to/project/Foo.app/Contents/MacOS/Foo

Jason Coco