这可以在 Xcode 编译之前运行 python 脚本吗? [英] Is this possible to run a python script before Xcode doing compiling?

查看:35
本文介绍了这可以在 Xcode 编译之前运行 python 脚本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Xcode 开发应用程序.但是我包含了一些测试文件,并且我想在编译时保留一个参考时间戳.我可以在开始编译程序之前编写一些脚本吗?当然,我可以在编译前手动运行脚本,但我想在一步中完成,推荐?谢谢.

I am using Xcode to develop application. But I include some test files, and I would like to keep a reference timestamp while I do compiling. Is this possible for me to do some scripting before I start compiling the programme? Of course, I can manually run the script before I compiling, but I would like to do it in one step, and recommend? Thanks.

推荐答案

您需要添加一个构建阶段.转到项目文件,Build Phases,单击工具栏菜单上的Editor,添加Build Phase,添加Run Script...您可以选择并拖动脚本以将其放在任何东西之前/之后.

You need to add a build phase. Go to the project file, Build Phases, click Editor on the tool bar menu, add Build Phase, Add Run Script... You can select and drag the script to put it before/after anything.

那么shell应该是/usr/bin/python,然后你可以在下面输入你的脚本.该脚本将在您每次构建时运行.

Then the shell should be /usr/bin/python, then you can type in your script below. The script will run every time you build.

这篇关于这可以在 Xcode 编译之前运行 python 脚本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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