Using xcodebuild To Export a .ipa From an Archive
Xcode 6 changes how you export a .ipa from an archive for adhoc distribution. It used to be that you could export the archive to a .ipa as long as you had the right provisioning profile and distribution certificate on your machine. Starting with Xcode 6 you need to be a team member of the particular Developer Program account and you need to have the rights to make a distribution build. This means you need to be a team agent. However, I work with a number of clients who don’t have the clue what Xcode is much less are willing to make distribution builds, so I need to way to make distribution builds within this new limitation from Xcode 6.
Making distribution builds hasn’t been a problem for me in the past. I ask the client to provide me1 with the necessary provisioning profile, distribution certificate, and public private key pair so I can make the distribution build for them. Then I use Xcode Organizer to export the archive to a .ipa that I can distribute.2 But it seems I can no longer export using Organizer without having the right team access, so I had to search out an alternative approach.
Turns out starting with Xcode 5, xcodebuild includes parameters for exporting from an archive. This is exactly what I need so I can continue making adhoc distribution builds for clients without being a team member or team agent under their Developer Program account.
So how do I do it?
The How To
My build script starts by performing a clean.
xcodebuild clean -project $projectname.xcodeproj -configuration Release -alltargets
Then the script builds and archives the app. I specify the archive path using the -archivePath parameter in the command line so the script will know where the archive file is located.
xcodebuild archive -project $projectname.xcodeproj -scheme $schemename -archivePath $projectname.xcarchive
Finally my script exports the archive into a .ipa file.
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile “Provisioning Profile Name”
I let the provisioning profile imply the signing identity, but you can specify the signing identity using the -exportSigningIdentity parameter.
The Gotcha
The one major gotcha that cost me a more than an hour of time was figuring out the parameter value for -exportProvisioningProfile. I initial thought it should be the file name to the provisioning profile. I tried it with and without the .mobileprovision file extension, but it did not work. I included a relative path as well as an absolute path to the provision profile. I tried using the UUID for the provision profile instead of the file name. I even I tried not including a path at all thinking it would look up the provision profile in the ~/Library/MobileDevice/Provisioning Profiles/ directory, but still no luck.
Turns out I needed to specify the name of the provisioning profile as defined in the file itself. This is the same name assigned to the profile in the provisioning portal. Once I figured this out I was able to export the .ipa from the archive using the my build script, and I don’t have to be a team agent under my client’s Developer Program account to make the distribution build.
- I usually assist my clients with this by guiding them through the steps, or I ask them to give me the account credentials with a temporary password so I can perform the necessary steps. Then I have the client reset the password. ↩
- I don’t export when I host the test app on HockeyApp. It takes care of exporting the .ipa from the archive for you. I only export when the client requests that the test app be hosted on their own server.) ↩
Using xcodebuild To Export a .ipa From an Archive的更多相关文章
- 了解 xcodebuild 命令 ,自动打包ipa
引用博客:http://blog.nswebfrog.com/2015/10/31/xcodebuild/ 在 iOS 开发中,如果需要把工程打包成 ipa 文件,通常的做法就是在 Xcode 里点击 ...
- 通过xcode或xcodebuild进行打包
在实际应用中需要用到debug的安装包,所以决定自己学习一下打包,打包过程中遇到了各种问题,下面记录了一下我在打包中用到的步骤,当然我还有很多不明白的地方,如果有不对的地方,希望可以大家可以指出 ...
- Building Xcode iOS projects and creating *.ipa file from the command line
For our development process of iOS applications, we are using Jenkins set up on the Mac Mini Server, ...
- 打包ipa出现问题记录
1.打包ipa事,Archive出现问题 解决方法:Xcode->系统偏好设置->Accounts->选中正在使用的账户->view details->download ...
- fastlane自动化打包ipa并发布到firim或者蒲公英
1.打开终端,确保Xcode Command Line Tools 安装了最新版 xcode-select --install 2.安装fastlane sudo gem install -n /us ...
- This manual page is part of Xcode Tools version 5.0
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.ht ...
- 基于python脚本,实现Unity全平台的自动打包
转载请标明出处:http://www.cnblogs.com/zblade/ 0. 概述 本文主要针对项目中自动打包过程进行调研,实现用python脚本来打出win/android/ios三个平台下的 ...
- iOS应用构建与部署小结
注:本文首发于我的个人博客:https://evilpan.com/2019/04/06/ios-basics/ 上篇文章介绍了Objective-C的基本概念,本文就来接着看如何创建我们的第一个简单 ...
- 使用gitlab ci构建IOS包并发送通知消息到企业微信
在之前的文章中,我们介绍了使用gitlab ci构建Android包的方法.今天我们介绍使用gitlab ci如何构建IOS包,并且在打包成功或者失败时,如何将消息通知到企业微信. 如果对gitlab ...
随机推荐
- Java系列学习说明
最近要回顾以前的开发知识了,每天一个案例,争取早日成为一名合格的程序猿,现在就是猴娃子级别的.
- RMAN 增量备份级别说明
通过Bat批处理调用RMan是我们定时备份数据库的好帮手,但是RMan的备份级别需要我们好好了解一下. RMAN备份全为全备和增量备份 增量备份:分为0 1 2级 ORACLE官方解释: A leve ...
- ASP.NET——实现两个下拉框动态联动
引入: 在网页中,我们经常会遇到下图中的情况.首先在下拉框中选择所在的省,选择之后,第二个下拉框会自动加载出该省中的市.这样设计极大的方便了用户的查找.那这是如何实现的呢? 1.建立数据库 " ...
- [洛谷P4925][1007]Scarlet的字符串不可能这么可爱
题目大意:问字符集大小为$k$,长度为$L$的字符串,且没有长度超过$1$的回文段的个数.规定第$s(若为0则无限制)$位为$w$. 题解:懒得写了,根据是否有限制分类讨论 卡点:中途有个地方忘记取模 ...
- [bzoj] 2453 维护数列 || 单点修改分块
原题 询问区间有种个颜色,单点修改某个位置. 修改次数<=1000 维护pre[i]为前一个与当前位置颜色一样的位置. 询问时以pre为关键字sort,lower_bound找pre<x的 ...
- zoj3161 Damn Couples
不想打题面了,题面戳这里 这道题目的模型转换地有点猛.首先我们肯定需要让老板把那些不相邻的人的卡牌放在前面,这样他们就作废了.然后剩下的卡牌就都是相邻人之间的了.我们就可以把这个序列分成若干个联通块, ...
- 一种提高Android应用进程存活率新方法
一.基础知识 1.Android 进程优先级 1.1 进程优先级等级一般分法:- Activte process- Visible Process- Service process- Backgrou ...
- SoundPool 播放提示音
SoundPool 一个声音播放的辅助类,从名字可以看出,它具有 “池”的能力,它先加载声音文件到内存,以支持多次播放声音文件. 特点 SoundPool适合 短小的 声音文件 SoundPool适合 ...
- python module :shelve
shelve 是一个 key-value 的数据库. 操作方法和字典几乎一致. shelve 模块功能:以 key - value 的方式存储数据. 写数据 >>> import s ...
- Android Sshd使用
1. 介绍 因为某些原因, 笔者需要在android上开发, 使用adb比较麻烦, 于是想使用sshd. 推荐的软件是openssh, 其他选择有dropbear, mosh.当然还有其他选择, 如 ...