在使用 Xcode 10 生成 dSYM 后运行脚本阶段(构建时) [英] Run Script Phase after dSYM is generated with Xcode 10 (on build)

查看:34
本文介绍了在使用 Xcode 10 生成 dSYM 后运行脚本阶段(构建时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dSYM 默认位置是 ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

您可以使用一个简短的脚本进行测试并观察其输出:

#!/bin/sh如果 [ !-d ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} ];然后echo "找不到 dsym 文件"出口 1菲stat -x ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

In the New Features section, it states:

  • In the new build system, shell scripts can't rely on the state of build artifacts not listed in other build phases (for example, the Info.plist file or .dSYM files.) Add files the script build phase depends on as explicit input dependencies to the shell script build phase. (40852184)

In previous Xcode, the script was executed successfully but now it can execute when the dSYM file size is 0.

How can I have a Run Script Phase that will start only after the dSYM file is generated?
How can I create an "explicit input dependencies to the shell script build phase" as they requested?

解决方案

A similar question can be found here:

Build phase script is running before needed files are created in Xcode 10

You need to add the dSYM as an input file dependency of your run script phase:

dSYM default location is ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

You can test this using a short script and observing its output:

#!/bin/sh

if [ ! -d ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} ]; then
    echo "Couldn't find dsym file"
    exit 1
fi

stat -x ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

这篇关于在使用 Xcode 10 生成 dSYM 后运行脚本阶段(构建时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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