自建网站安装iOS APP Shell使用

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

<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 "完成文件输出"

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 9,941评论 0 5
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,308评论 19 139
  • .bat脚本基本命令语法 目录 批处理的常见命令(未列举的命令还比较多,请查阅帮助信息) 1、REM 和 :: 2...
    庆庆庆庆庆阅读 12,552评论 1 19
  • 旅行久了,会遇到很多重复的提问, 游荡的前三年,我几乎有问必答, 第五年,开始有些厌倦, 第七年,只挑乐意答的答。...
    游民王阿牛阅读 4,442评论 5 20
  • “曼曼去了纳木错。” 这是时隔两年之后,陆铭微信上跟我说的第一句话。 微信发送时间是晚上23:21,夜还不算太深,...
    卡西_阅读 8,560评论 27 52