shell脚本删除指定mobileprovision

  由于某种原因,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

 

posted @ 2015-06-03 11:32  Ethan_村长  阅读(478)  评论(0编辑  收藏  举报