单个替换
sed -i "" "s/reboot/reb/g" /Users/zhengdongxi/Desktop/reboot.sh
多个替换
sed -i "" "s/aaa/AAA/g ; s/bbb/BBB/g" /Users/zhengdongxi/Desktop/reboot.sh
删除第几行
sed -i "" "3d" /Users/zhengdongxi/Desktop/reboot.sh
插入反斜杠
sed -i "" "4s/user/\\/user/g" /Users/zhengdongxi/Desktop/reboot.sh
修改项目bundle identifer
sed -i "" "s/${OLD_PRODUCT_BUNDLE_IDENTIFIER1}/${PRODUCT_BUNDLE_IDENTIFIER}/g" ${PROJECT_NAME}.xcodeproj/project.pbxproj
修改app名称
/usr/libexec/PlistBuddy -c "Set CFBundleDisplayName $DISPLAY_NAME"
$INFOPLIST
修改项目bundle ID
/usr/libexec/PlistBuddy -c "Set CFBundleIdentifier $BUNDLE_ID" $INFOPLIST
修改项目版本号
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION_NAME" $INFOPLIST
修改项目构建号
#构建版本先读取之前的BUILD_CODE,加1得到新的BUILD_CODE
BUILD_CODE=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $INFOPLIST)
BUILD_CODE=`expr $BUILD_CODE + 1`
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $BUILD_CODE" $INFOPLIST
网友评论