shell脚本从SVN下载项目并自动打包IPA和plist文件

#!/bin/bash

cd desktop

ipa=/Users/ljq/Desktop/path/merchant.ipa #打包后ipa存储目录


plistPath=/Users/ljq/Desktop/path  #打包后plist存储目录


targetName=targetName #项目名称

targetPath=/Users/ljq/Desktop/targetName #项目路径


svnHttps=svnPath #svn下载项目路径

#plist文件需要修改的参数
url=ipaDownloadPath #ipa下载路径


identifier=com.xxxxxxxx #bundle-identifier


version=6.6 #bundle-version


title=title #title


svn checkout ${svnHttps} #svn下载项目文件


cd $targetPath



/usr/bin/xcodebuild -target $targetName clean #清理工程



/usr/bin/xcodebuild -target $targetName  #打包.app


/usr/bin/xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/$targetName.app -o $ipa   # 打包.ipa


#rmdir xxxx #删除文件夹


cd $plistPath


#生成plist文件
cat << EOF > $targetName.plist
<?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>$url</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>$identifier</string>
                <key>bundle-version</key>
                <string>$version</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>$title</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

EOF

rm -rdf build   #delete build
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值