-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreateIPA.sh
More file actions
executable file
·36 lines (25 loc) · 1.29 KB
/
createIPA.sh
File metadata and controls
executable file
·36 lines (25 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#created by NearEast
#updated 2017-05-04
#默认使用当前文件夹的名字作为xCode工程的名字,并且当前文件夹为xCode工程所在的文件夹
#如果不符合以上条件,修改脚本对应内容即可
version=$1
projectName=`pwd | awk -F "/" '{print $NF}'`
outputPath=~/Desktop/tmp
buildPath=${outputPath}/xcodeBuild
echo 'using version number '${version}
echo 'using projectName '${projectName}
dateToday=`date +%Y%m%d`
NE_BUILDID=${dateToday}.`git rev-list HEAD | wc -l | awk '{print $1}'`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${NE_BUILDID}" ${projectName}/Info.plist
if [ -z $version ];then
echo 'using old version number'
else
echo 'using new version:${version}'
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${version}" ${projectName}/Info.plist
fi
xcodebuild -workspace ${projectName}.xcworkspace -scheme ${projectName} -configuration Release clean build ARCHS='armv7 arm64' -sdk iphoneos CODE_SIGN_IDENTITY="iPhone Distribution: Leshi Co., Ltd" PROVISIONING_PROFILE=CommonEntpInHouseProvisionProfile SYMROOT="${buildPath}"
xcrun -sdk iphoneos PackageApplication \
${buildPath}/Release-iphoneos/${projectName}.app \
-o ${outputPath}/${projectName}${NE_BUILDID}.ipa
echo 'output ipa: '${outputPath}'/'${projectName}${NE_BUILDID}'.ipa'
rm -rf ${build_path}