xcode xcodebuild:找到输出应用程序文件的位置

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

xcodebuild: find where the output app file is

xcodemacosxcodebuild

提问by hzxu

Is there anyway to specify where to put the output file (ie .app) for xcodebuild? By default it is in:

无论如何要指定 xcodebuild 的输出文件(即 .app)放在哪里?默认情况下,它位于:

/Users/myusername/Library/Developer/Xcode/DerivedData/Project-crkyjjbuqqnqqvfxehsjsarzlbbr/Build/Products/Release-iphoneos/Project.app

/Users/myusername/Library/Developer/Xcode/DerivedData/Project-crkyjjbuqqnqqvfxehsjsarzlbbr/Build/Products/Release-iphoneos/Project.app

As I need to find the output Project.app file, if there is no way to specify the path, can I use a script to look for that "/Users/myusername/Library/Developer/Xcode/DerivedData/" folder and inside it find the one with latest modified date and prefix "Project-"? What does the script look like?

由于我需要找到输出 Project.app 文件,如果无法指定路径,我可以使用脚本来查找“/Users/myusername/Library/Developer/Xcode/DerivedData/”文件夹及其内部找到具有最新修改日期和前缀“Project-”的那个?剧本是什么样的?

Thanks

谢谢

回答by Nathaniel Irons

Override the CONFIGURATION_BUILD_DIR environment variable in an xcodebuild argument. For instance, this command would put its build products under "/tmp/sportsball/":

覆盖 xcodebuild 参数中的 CONFIGURATION_BUILD_DIR 环境变量。例如,此命令会将其构建产品放在“/tmp/sportsball/”下:

xcodebuild -workspace Sportsball.xcworkspace -scheme "Sportsball Debug" -configuration Debug clean build CONFIGURATION_BUILD_DIR=/tmp/sportsball/

xcodebuild -workspace Sportsball.xcworkspace -scheme "Sportsball Debug" -configuration Debug clean build CONFIGURATION_BUILD_DIR=/tmp/sportsball/