xcode 从终端打开 iPhone 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/419859/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open an iPhone application from the terminal
提问by Bharat jain
Is it possible to open an iPhone application or an Xcode project from the terminal? I have already tried:
是否可以从终端打开 iPhone 应用程序或 Xcode 项目?我已经尝试过:
open /path/to/project.app
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?
但这会返回警告并由于启动模拟器时图像加载错误而意外退出。有没有人有什么建议?
回答by Jason Coco
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.
您无法从终端启动 iPhone 应用程序。当您构建 Xcode 项目时,它所做的部分工作是将应用程序“安装”到 iPhone 模拟器,就像在真实环境中一样。例如,如果您删除 Xcode 项目和所有文件,然后运行模拟器,您仍然会在那里找到您的应用程序。它旨在尽可能地模拟真实环境。但是,您可以xcodebuild
从终端使用来构建和更新您的项目文件,然后自己运行模拟器应用程序。
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:
对于常规的 Mac OS X 应用程序,您可以从终端运行它们,但您必须记住,project.app 只是一个目录包装器,Finder 将其伪装成用户的单文件应用程序。您的实际可执行文件位于/path/to/project.app/Contents/MacOS/project
. 因此,例如,如果我有一个生成应用程序 Foo.app 的项目,我会从终端启动它:
$ /path/to/project/Foo.app/Contents/MacOS/Foo
$ /path/to/project/Foo.app/Contents/MacOS/Foo
回答by Bharat jain
You can launch iPhone app from Terminal thanks to idevice.
由于 idevice,您可以从终端启动 iPhone 应用程序。