Xcode方案预行动脚本未运行 [英] Xcode scheme pre-action script not running

查看:71
本文介绍了Xcode方案预行动脚本未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命中构建,构建日志中不打印任何内容.有什么作用?

Hit build and nothing gets printed in build log. What gives?

Xcode版本8.2.1(8C1002)

Xcode Version 8.2.1 (8C1002)

推荐答案

在生成之前进行预操作,因此输出不会转到生成日志中,而是转到stdErr.您可以将输出复制到文件:

Pre-action takes place before the build, so output doesn't go to the build log, it goes to stdErr. You can copy the output to a file:

exec > ${PROJECT_DIR}/prebuild.log 2>&1
echo "hello world"

要使环境变量正常工作,还需要将提供构建设置自"设置为适当的目标.

To get the environment variables to work, you also need to set "Provide build settings from" to the appropriate target.

这应该将 hello world 写入项目文件夹中名为"prebuild.log"的文件中.

That should write hello world to a file named "prebuild.log" in your project folder.

如果您希望这些活动结束在构建日志中,请考虑将运行脚本添加到目标的构建阶段.

If you want these activities to end up in the build log, consider adding a run script to your target's build phase instead.

这篇关于Xcode方案预行动脚本未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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