前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >XCode打包脚本

XCode打包脚本

作者头像
meteoric
发布2018-11-19 18:03:43
1.1K0
发布2018-11-19 18:03:43
举报
文章被收录于专栏:游戏杂谈游戏杂谈
代码语言:javascript
复制
#!/bin/bash

#for debug
#请将 TARGET-NAME 改成项目的 TARGET 名称
#放置于 .xcodeproj 同级目录中执行
 
target_name="xx"
tmp_dir="tmp"
profile="xxx-xxx-xxx-xxx-xxx"
profile_name="xx-Dev"
sign="iPhone Developer: xxxx"
TIMESTAMP=`date +"%Y%m%d%H%M"`
ipa=ipaName_debug.$TIMESTAMP.ipa
 
#rm -rf $tmp_dir
rm $ipa
 
xcodebuild -target $target_name -sdk iphoneos -configuration Debug ARCHS="armv7 armv7s armv64" CONFIGURATION_BUILD_DIR=$tmp_dir PROVISIONING_PROFILE="$profile"
 
xcodebuild -scheme $target_name -destination generic/platform=iOS archive CODE_SIGN_IDENTITY="$sign" -archivePath $tmp_dir/target.xcarchive PROVISIONING_PROFILE="$profile"
 
xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile "$profile_name" -archivePath $tmp_dir/target.xcarchive/ -exportPath ./$ipa
 
#rm -rf $tmp_dir
 
 
   
  
#for relese
 
profile="xxx-xxx-xxx-xxx-xxx"
profile_name="xxx-AdHoc"
sign="iPhone Distribution: xxxxxxxx"
ipa=ipaName_release.$TIMESTAMP.ipa
 
#rm -rf $tmp_dir
rm $ipa
 
xcodebuild -target $target_name -sdk iphoneos -configuration Release ARCHS="armv7 armv7s armv64" CONFIGURATION_BUILD_DIR=$tmp_dir PROVISIONING_PROFILE="$profile"
 
xcodebuild -scheme $target_name -destination generic/platform=iOS archive CODE_SIGN_IDENTITY="$sign" -archivePath $tmp_dir/target.xcarchive PROVISIONING_PROFILE="$profile"
 
xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile "$profile_name" -archivePath $tmp_dir/target.xcarchive/ -exportPath ./$ipa
 
#rm -rf $tmp_dir

配置之后,执行上面的脚本就会在.xcodeproject目录下生成debug、release的ipa

本文参考:

Xcode 6.1下使用xcodebuild出错

xcodebuild can't build when no physical iOS

xcode-sh

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2015-08-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档