自动备份dSYM文件脚本


最原始的sh文件地址再这里

http://www.cimgf.com/2009/12/23/automatically-save-the-dsym-files/

但是这个sh脚本,不能对debug和模拟器已经没有目录的情况下操作。并且目录的位置也存在一些小问题。所以再这个基础上面,我修改了一下,这样可以保证再任何情况下,都可以正确的备份文件了。

echo "starting dsym archiving"


if [ "$BUILD_STYLE" == "Debug" ]; then
echo "Skipping debug"
echo "exit 0;"
fi


if [ "$EFFECTIVE_PLATFORM_NAME" == "-iphonesimulator" ]; then
echo "Skipping simulator build"
echo "exit 0;"
fi


echo "TARGET_BUILD_DIR:${TARGET_BUILD_DIR}"
echo "DERIVED_FILE_DIR:${DERIVED_FILE_DIR}"


echo "ARCHIVE_DSYMS_PATH:${ARCHIVE_DSYMS_PATH}"
echo "ARCHIVE_PRODUCTS_PATH:"$ARCHIVE_PRODUCTS_PATH
echo "ARCHIVE_PATH:${ARCHIVE_PATH}"


echo "SRC_PATH=${ARCHIVE_DSYMS_PATH}/${DWARF_DSYM_FILE_NAME}"


SRC_PATH=${TARGET_BUILD_DIR}/${DWARF_DSYM_FILE_NAME}
RELATIVE_DEST_PATH=dSYM/${EXECUTABLE_NAME}.$(date +%Y%m%d%H%M%S).app.dSYM
DEST_PATH=${PROJECT_DIR}/${RELATIVE_DEST_PATH}
echo "moving ${SRC_PATH} to ${DEST_PATH}"


mkdir -p "${DEST_PATH}"


cp -r "${SRC_PATH}" "${DEST_PATH}"


if [ -f ".git/config" ]; then
git add "${RELATIVE_DEST_PATH}"
git commit -m "Added dSYM file for ${BUILD_STYLE} build" "${RELATIVE_DEST_PATH}"
fi


你可能感兴趣的:(自动备份dSYM文件脚本)