美文网首页
一个把简单.app打包成.ipa的shell

一个把简单.app打包成.ipa的shell

作者: OneByte | 来源:发表于2018-08-17 10:44 被阅读12次

步骤一

拷贝代码到 your.sh 文件

#!/bin/sh
app_path=${1}
to_path=${2}
app_file=$(basename $app_path .app)

echo $to_path
if [ -z "${to_path}" ];then
    echo "-z ${to_path}"
     to_path="$(dirname $app_path)"
fi

ipa_name="${app_file}.ipa"
if [ "${app_path##*.}" != "app" ];then
    echo "${app_path} suffix is not app!!!";
    exit 1;
fi

if [ ! -d "${app_path}" ];then
    echo "${app_path} is not exsit!!!";
    exit 1;
fi

zip_file="Payload"
if [ -d $zip_file ];then
    rm -d $zip_file
fi
mkdir $zip_file

cp -af ${app_path} ${zip_file}
zip -r ${ipa_name} ${zip_file}
rm -rf $zip_file
mv -f ${ipa_name} ${to_path}

echo "ipa mv to ${to_path}/"

步骤二

chmod 777 your.sh 

步骤三

终端输入:

  your.sh app_path ipa_path

相关文章

网友评论

      本文标题:一个把简单.app打包成.ipa的shell

      本文链接:https://www.haomeiwen.com/subject/kadzbftx.html