根据bundleid修改bundlename

在Build Phases中添加脚本

#!/bin/bash
bundleID=${PRODUCT_BUNDLE_IDENTIFIER}
echo $bundleID
result=$(echo $bundleID | grep "knamestr")
if [[ "$result" != "" ]] ; then
    /usr/libexec/PlistBuddy -c "Set :CFBundleName 名称1" "$INFOPLIST_FILE"
else
    /usr/libexec/PlistBuddy -c "Set :CFBundleName 名称2" "$INFOPLIST_FILE"
fi

你可能感兴趣的:(根据bundleid修改bundlename)