dirname $0
cd dirname \$0
ipa里面的app文件路径
debug_app_path='/path/name.app'
证书名不用改
certificate_title="证书名"
签名配置文件不用改
mobileprovision_path="/path/配置文件"
中转文件夹路径
ipa_path_dir="$(pwd)/ipas"
ipa_path_payload="$ipa_path_dir/Payload"
rm -rf $ipa_path_payload
mkdir -p $ipa_path_payload
复制app文件
cp -R ipa_path_payload
cd$ipa_path_payload
appname1=find . -name '*.app' -maxdepth 1
appname=${appname1#*/}
if[[ mobileprovision_path !=""]];then
echo************************正在重签名****************************
cp ipa_path_payload/$appname/embedded.mobileprovision"
echo"重签名证书: $certificate_title">&2
find -d $ipa_path_dir ( -name".app"-o -name".appex"-o -name".framework"-o -name".dylib") > directories.txt
生成full.plist
security cms -D -i"appname/embedded.mobileprovision"> t_entitlements_full.plist
/usr/libexec/PlistBuddy -x -c'Print:Entitlements't_entitlements_full.plist > t_entitlements.plist
whileIFS=''read-r line || [[ -n"$line"]];do
重签
/usr/bin/codesign --continue-f -s"$certificate_title"--entitlements"t_entitlements.plist" "$line"
done< directories.txt
rm directories.txt
rm t_entitlements.plist
rm t_entitlements_full.plist
fi
echo**************************正在打包成ipa*********************************
重签名文件夹路径
ipa_file_path=$ipa_path_dir/test.ipa
rm -rf $ipa_file_path
cd $ipa_path_payload
cd..
zip -qry $ipa_file_path Payload
rm -rf $ipa_path_payload
echo ipa包路径:$ipa_file_path
echo********正在安装**********
ideviceinstaller -i $ipa_file_path
网友评论