Mac OSX - Xcode 安装目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/636810/
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
Mac OSX - Xcode Installation Directory
提问by Ben Reeves
After Xcode has finished building is there a way to make it copy the executable to specific directory
Xcode 完成构建后,有没有办法让它将可执行文件复制到特定目录
~/Sites/cgi-bin/
~/站点/cgi-bin/
I have the target Installation Directory
set to the correct folder, with skip installation
unchecked, but no luck.
我将目标Installation Directory
设置为正确的文件夹,skip installation
未选中,但没有运气。
Is there something i'm missing?
有什么我想念的吗?
回答by cdespinosa
Check the "Deployment Postprocessing" build setting in your target's Release configuration. Installation is normally done only with a command-line xcodebuild install, but setting Deployment Postprocessing makes it install on every build.
检查目标的发布配置中的“部署后处理”构建设置。安装通常仅通过命令行 xcodebuild 安装完成,但设置部署后处理使其安装在每个构建上。
Ensure your user account has write privileges in the directory you want to install in, because the IDE normally doesn't run with root privileges.
确保您的用户帐户在要安装的目录中具有写入权限,因为 IDE 通常不会以 root 权限运行。
回答by Hsin
In build phasesdown right corner Add Build Phase run script, add such as mv -f ${SYMROOT}/debug/projectname ~/Library/projectname
在构建阶段右下角添加构建阶段运行脚本,添加如 mv -f ${SYMROOT}/debug/projectname ~/Library/projectname
回答by James Moore
Perhaps an easier approach is to add a "Copy Files" build phase. Set the Destination to "Absolute Path" and the Subpath to where you want it copied on disk. Both tilde expansion and $HOME can be used in the Subpath.
也许更简单的方法是添加“复制文件”构建阶段。将目标设置为“绝对路径”,将子路径设置为您希望将其复制到磁盘上的位置。波浪号扩展和 $HOME 都可以在子路径中使用。
回答by Markus
Besides setting the "Installation Directory", make sure you also set DSTROOT (Installation Build Productions Location) in the settings to "/".
除了设置“安装目录”之外,请确保您还在设置中将 DSTROOT(安装构建产品位置)设置为“/”。