简体   繁体   English

将外部脚本添加到Xcode4

[英]Adding external scripts to Xcode4

I need to do some tasks before any Archive launched in Xcode. 在Xcode中启动任何存档之前,我需要做一些任务。

Is there any way in Xcode to add a .sh or .py script run before Archive ? Xcode中有什么方法可以在存档之前添加.sh或.py脚本运行?

PS : I can complete these tasks by hand but it requires time, some tasks might be forgotten or if the process is done by someone else all the tasks can be forgotten. PS:我可以手动完成这些任务,但是这需要时间,有些任务可能会被遗忘,或者如果流程是由其他人完成的,那么所有任务都可能会被遗忘。 The problem is that these tasks are required to have a successfull Apple validation. 问题是要成功进行Apple验证,必须执行这些任务。

Thanks 谢谢

You can add script build phases at any point between the existing phases. 您可以在现有阶段之间的任何时间添加脚本构建阶段。 Here is a post which shows you how . 这是一则帖子,向您展示如何 In Xcode 4 you select your project, then go to the build phases tab were you usually have the "target dependencies", "compile sources", "Link binary with libraries" and "copy bundle resources" phases, just click on "Add build phase" and select "Add run script". 在Xcode 4中,选择项目,然后转到“构建阶段”选项卡,您通常具有“目标依赖项”,“编译源代码”,“与库链接二进制文件”和“复制捆绑包资源”两个阶段,只需单击“添加构建”阶段”,然后选择“添加运行脚本”。 You can select your shell, but not script in python from there. 您可以选择外壳,但不能从那里选择python脚本。

You can also look at building xcode projects from the command line . 您也可以从命令行查看构建xcode项目 You could call that command line from a python script and do anything else you want from "outside" the Xcode project. 您可以从python脚本调用该命令行,然后在Xcode项目的“外部”执行其他任何所需的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM