美文网首页
自建网站安装iOS APP Shell使用

自建网站安装iOS APP Shell使用

作者: 衡杰说 | 来源:发表于2018-04-02 15:31 被阅读0次

安装的时候,需要带上如下路径

<a title="iphone" href="itms-services://?action=download-manifest&amp;url=https://hunred/install/install.plist">安装测试按钮</a>
其中,名称必须是install.plist !!!

注意一下 使用cat <<EOF 变量的时候采用的方式${name}

#!/bin/sh

ipaDownloadUrl="" # 下载ipa地址
fullsize_image=""   # 2xLogo图片 暂时使用全路径把
display_image=""         # 1xLogo图片
# fullsize_image="./icon/logo@2x.png"   # 2xLogo图片
# display_image="./icon/logo.png"         # 1xLogo图片
certification="com.hundred.c" #证书
name="hundred"    # 名称
tag="1.0.12.1"     # 版本号

plistPath="./svnFile/install.plist"
ipaPath="./svnFile/smlcs.ipa"
iconPath="./icon"
targetPath="./svnFile/icon"
OriginIpaPath="私募理财师.ipa"

echo "清理文件"
if [ -f "$plistPath" ]; then
    echo "删除原来Plist的文件"
    rm "$plistPath"
fi

if [ -f "$ipaPath" ]; then
    echo "删除原来Ipa的文件"
    rm "$ipaPath"
fi

if [ -f "$OriginIpaPath" ]; then
    echo "复制ipa"
    cp "$OriginIpaPath" "$ipaPath"
    echo "!!完成ipa复制!!"
fi
if [ -r "$targetPath" ]; then
    echo "删除原来的Icon"
    rm -r "$targetPath"
    cp -r "$iconPath" "$targetPath"
    echo "!!完成图片资源复制!!"
else
    cp -r "$iconPath" "$targetPath"
    echo "!!完成图片资源复制!!"
fi

echo "完成清理,开始文件编辑"

(
cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>items</key>
    <array>
        <dict>
            <key>assets</key>
            <array>
                <dict>
                    <key>kind</key>
                    <string>software-package</string>
                    <key>url</key>
                    <string>${ipaDownloadUrl}</string>
                </dict>
              <dict>  
                    <key>kind</key>  
                    <string>full-size-image</string>  
                    <key>needs-shine</key>  
                    <true/>  
                    <key>url</key>  
                    <string>${fullsize_image}</string>  
                </dict>  
                <dict>  
                    <key>kind</key>  
                    <string>display-image</string>  
                    <key>needs-shine</key>  
                    <true/>  
                    <key>url</key>  
                    <string>${display_image}</string>  
                </dict>  
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>${certification}</string>
                <key>bundle-version</key>
                <string>${tag}</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>   
                <string>${name}</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

EOF
) > ${plistPath}
echo "完成文件输出"

相关文章

网友评论

      本文标题:自建网站安装iOS APP Shell使用

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