gpt4 book ai didi

ios - 如何在 xcode 构建阶段运行脚本中检查 appledoc 是否有效?

转载 作者:行者123 更新时间:2023-11-29 12:56:12 25 4
gpt4 key购买 nike

i'm working in generating docset for a ios project, but stumped. 

as you known, we can write a sh script for the xcode build phases run script; and i want it run only when the project in release version & the software appledoc already installed, so i write it as follows:

# appledoc Xcode script
APPLEDOC_PATH=`which appledoc`
if [ $APPLEDOC_PATH ]; then
if [ "${CONFIGURATION}" = "Release" ]; then
#============================#
# some code here, omit! #
#============================#
fi
fi

好像完全不行!我知道问题是命令 'which appledoc' 出错了!所以问题是:

how to check appledoc valid or not in the xcode build phases run script?any ideas? please give a hand! thanks!

最佳答案

几天前我遇到了这个问题。如果执行文件不在/bin/sh 下。可能找不到该命令。

!!使用完整路径!!

我用macports安装了appledoc,bin路径是/opt/local/bin。

因此,它变成了“ls”命令而不是“which”命令。

看起来没有让 port 命令返回其 bin 路径的选项。如果其他包管理器可以做到,请不要编写那样的硬代码。

我检查了 $PATH 并用 Xcode 脚本打印了它。路径/opt/local/bin 是存在的。所以我仍然不知道为什么它在脚本中找不到appledoc。

关于ios - 如何在 xcode 构建阶段运行脚本中检查 appledoc 是否有效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21035709/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com