Question

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?

Was it helpful?

Solution

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

OTHER TIPS

Kudos

You can Launch iPhone app from terminal . Thanks to idevice .

https://stackoverflow.com/a/31271484/4622092/

Check this Link .

You can use simctl to control iOS simulators from command line(Terminal) For example to install an .app file inside simulator use

xcrun simctl install booted <path_to_file.app>

Or to launch the app that has been installed

xcrun simctl launch booted <app_bundle_identifier>

Please read more here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top