根据方案包括/排除资源 [英] Include/exclude resources depending on scheme

查看:388
本文介绍了根据方案包括/排除资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些我只需要运行模拟器的大型资源 - 我想让它们自动从所有设备版本中排除。有没有办法用Xcode 4来复制资源的自定义构建脚本?

I have some large resources that I only need for my simulator runs—I'd like to have them automatically excluded from all device builds. Is there any way to do this with Xcode 4 short of custom build scripts that copy the resources?

推荐答案

我去了一个Run脚本阶段包含以下内容:

I went with a Run Script phase with the following:

if [ ${PLATFORM_NAME} != "iphonesimulator" ]; then 
    echo "device build -- removing resources..."
    rm "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/test_a.mp3"
    rm "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/test_b.mp3"
    # reveal the binary in the Finder
    /usr/bin/open --reveal "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
    echo "simulator build..."
fi

这篇关于根据方案包括/排除资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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