您的位置:首页 > 运维架构 > Shell

How to Run a Custom Shell Script During an XCODE Build

2015-11-12 21:05 811 查看
Right click on the specific target in XCODE



You can enter your shell script like this, here is a sample script to list available variables.



Build and Run and come open build results to see your script results.




Xcode
4 build setting variables for scheme scripts

转自:http://stackoverflow.com/questions/5319989/xcode-4-build-setting-variables-for-scheme-scripts

Apart from that, if you select "None", there will be a bunch of environment variables set by Xcode. You can discover all of them by doing something like
printenv
> ~/Desktop/printenv.txt
to have them dumped to a text file.

Some of the more useful environment variables include
ARCHIVE_PATH
,
SCHEME_NAME
,
USER
,
ARCHIVE_DSYMS_PATH
,
ARCHIVE_PRODUCTS_PATH
.

参考说明
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcrun.1.html shell的官方参考网页
https://developer.apple.com/library/ href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=18&is_app=0&jk=32e722cb7188cf3&k=mac&k0=mac&kdi0=0&luki=2&mcpm=0&n=10&p=baidu&q=55063160_cpr&rb=0&rs=1&seller_id=1&sid=f38c18b72c722e03&ssp2=1&stid=0&t=tpclicked3_hc&td=1722090&tu=u1722090&u=http%3A%2F%2Fit%2Ezhaozhao%2Einfo%2Farchives%2F46023&urlid=0" target=_blank>mac/#documentation/OpenSource/Conceptual/ShellScripting/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004268-TP40003516
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: