Open an iPhone application from the terminal

不问归期 提交于 2019-12-14 02:27:17

问题


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?


回答1:


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




回答2:


Kudos

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

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

Check this Link .



来源:https://stackoverflow.com/questions/419859/open-an-iphone-application-from-the-terminal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!