问题描述
我使用以下命令从.xcodeproj的目录中使用 xcodebuild
来构建项目。
admin $ xcodebuild install DSTROOT =。 INSTALL_PATH = / bin
有人可以告诉我如何指定.xcodeproj的完整路径 xcodebuild
命令并从任何地方运行它?
...所以你不能使用xcodebuild命令指定项目的绝对路径,但你可以指定你想要的.app文件放置如下。您需要从根项目目录运行此命令,您将能够编译其他子项目没有CD到其目录,但您需要指定您正在构建的方案。
admin $ xcodebuild install DSTROOT = / Users / admin / myProjectRoot INSTALL_PATH = / bin -scheme MySubProject1 -configuration Release -sdk iphonesimulator clean build
,您必须启动 xcodebuild
从您的项目所在的目录。 I.E.明确的具体行是:
如果该目录中有多个项目,可以使用 -project projectname
命令行参数。
在我自己的构建脚本中, c $ c> cd 到项目所在的文件夹。 xcodebuild
I use following command to build project using xcodebuild
from the directory where .xcodeproj is.
admin$ xcodebuild install DSTROOT=. INSTALL_PATH=/bin
Could someone please tell me how to specify full path of .xcodeproj in xcodebuild
command and run it from anywhere?
[EDIT]
...so you cannot specify absolute path of the project with xcodebuild command but you can specify where do you want your .app file placed like following. You need to run this command from the root project directory and you will be able to compile other sub projects without CD to their directories but you need to specify "scheme" that you are building.
admin$ xcodebuild install DSTROOT=/Users/admin/myProjectRoot INSTALL_PATH=/bin -scheme MySubProject1 -configuration Release -sdk iphonesimulator clean build
According to the manpage for xcodebuild, you must launch "xcodebuild
" from within the directory where your project is. I.E. the specific line that clarifies that is:
And if there are multiple projects within that directory, that's when you can use the "-project projectname
" command line parameter.
In my own build scripts, I "cd
" to the folder where the project lives before calling "xcodebuild
".
这篇关于iOS:带xcodebuild的绝对项目路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!