iOS:带xcodebuild的绝对项目路径 [英] iOS: Absolute project path with xcodebuild

查看:317
本文介绍了iOS:带xcodebuild的绝对项目路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令从.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的联机帮助,您必须启动 xcodebuild 从您的项目所在的目录。 I.E.明确的具体行是:


要构建一个Xcode项目,从包含你的项目的目录
运行xcodebuild该目录包含
projectname.xcodeproj包)。


如果该目录中有多个项目,可以使用 -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:

To build an Xcode project, run xcodebuild from the directory containing your project (i.e. the directory containing the projectname.xcodeproj package).

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的绝对项目路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆