您的位置:首页 > 运维架构 > Shell

自动更新svn和打包ipa包 shell脚本

2016-09-07 17:32 579 查看
#!/bin/bash

cd desktop

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

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

targetName=merchant #项目名称

targetPath=/Users/hrt/Desktop/HYBmerchant #项目路径

svnHttps=svnDownloadPath#svn下载项目路径

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

identifier=plist bundle-identifier #plist 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: