xcode 从终端启动 xcodeproj

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/419517/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:27:28  来源:igfitidea点击:

launch a xcodeproj from terminal

iphonexcode

提问by Kyle Clegg

I trying to build and compile my xcodeprojin command line and it is working now.

我正在尝试构建和编译我xcodeproj的命令行,现在它正在运行。

So it is also possible to launch the xcodeprojectfrom terminal instead from the Xcode?

那么也可以xcodeproject从终端启动而不是从 Xcode 启动?

采纳答案by Kyle Clegg

If you want to run an app from the command line, use

如果要从命令行运行应用程序,请使用

open /path/to/appname.app

"Build and Go" is really just equivalent to

“Build and Go”实际上只是相当于

xcodebuild [parameters] && open /path/to/appname.app

回答by Kyle Clegg

To run an Xcode project from terminal:

从终端运行 Xcode 项目:

open *.xcodeproj

open *.xcodeproj

It may also be helpful to create an alias:

创建别名也可能会有所帮助:

alias xcode="open *.xcodeproj"

回答by Stephen Darlington

Are you asking for the command to build from the command-line?

您是否要求从命令行构建命令?

It's just:

只是:

xcodebuild

There are lots of options available to pick non-default options:

有很多选项可用于选择非默认选项:

Usage: xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target <targetname>]... [-parallelizeTargets] [-activeconfiguration] [-configuration <configurationname>] [-sdk <sdkfullpath>|<sdkname>] [<buildsetting>=<value>]... [<buildaction>]...
   xcodebuild [-version [-sdk <sdkfullpath>|<sdkname>]]
   xcodebuild [-showsdks]
   xcodebuild [-find <binary>] [-sdk <sdkfullpath>|<sdkname>]
   xcodebuild [-list]

回答by cdespinosa

xcodebuild -configuration Debug; open /path/to/build/Debug/your.app

xcodebuild -配置调试;打开/path/to/build/Debug/your.app

BTW You can open any LaunchServices-findable app with a given document just by executing open -a without a path or extension, e.g. open -a Xcode myProject.xcodeproj

顺便说一句,您可以通过执行 open -a 不带路径或扩展名,例如 open -a Xcode myProject.xcodeproj 来打开具有给定文档的任何 LaunchServices-findable 应用程序

回答by Hunter Monk

In terminal, in your project directory, just run:

在终端中,在您的项目目录中,只需运行:

xed .

Bonus:xedwill correctly choose the .xcworkspaceif one is available.

奖励:如果可用,xed将正确选择.xcworkspace