shell腳本刪除指定mobileprovision

  因爲某種緣由,xcode幫我按照了幾千個開發和上線證書,須要刪除這部分證書:xcode

  

#dir="/Users/Ethan/Library/MobileDevice/Provisioning Profiles/"
dir="/Users/Ethan/Desktop/test/"


filelist=`ls "${dir}"`
#echo $filelist

for filename in $filelist
do
PROFILE_FILE="${dir}${filename}"
#echo ${PROFILE_FILE}
appidname=`egrep -a -A 2 AppIDName "${PROFILE_FILE}" | grep string | sed -e 's/<string>//' -e 's/<\/string>//' -e 's/ //'`
#echo $appidname
IdentifierPrefix=`egrep -a -A 2 ApplicationIdentifierPrefix "${PROFILE_FILE}" | grep string | sed -e 's/<string>//' -e 's/<\/string>//' -e 's/ //'`
#echo $IdentifierPrefix


first=${appidname:0:2}

if [ ${IdentifierPrefix} == "H57E834M6D" ]&&[ ${first} == "m" ]
then
rm "${PROFILE_FILE}"
fi


done
相關文章
相關標籤/搜索