本文主要是介绍shell脚本从SVN下载项目并自动打包IPA和plist文件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#!/bin/bashcd 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
这篇关于shell脚本从SVN下载项目并自动打包IPA和plist文件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!