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的更多相关文章

  1. 了解 xcodebuild 命令 ,自动打包ipa

    引用博客:http://blog.nswebfrog.com/2015/10/31/xcodebuild/ 在 iOS 开发中,如果需要把工程打包成 ipa 文件,通常的做法就是在 Xcode 里点击 ...

  2. 通过xcode或xcodebuild进行打包

    在实际应用中需要用到debug的安装包,所以决定自己学习一下打包,打包过程中遇到了各种问题,下面记录了一下我在打包中用到的步骤,当然我还有很多不明白的地方,如果有不对的地方,希望可以大家可以指出   ...

  3. 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, ...

  4. 打包ipa出现问题记录

    1.打包ipa事,Archive出现问题 解决方法:Xcode->系统偏好设置->Accounts->选中正在使用的账户->view details->download ...

  5. fastlane自动化打包ipa并发布到firim或者蒲公英

    1.打开终端,确保Xcode Command Line Tools 安装了最新版 xcode-select --install 2.安装fastlane sudo gem install -n /us ...

  6. 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 ...

  7. 基于python脚本,实现Unity全平台的自动打包

    转载请标明出处:http://www.cnblogs.com/zblade/ 0. 概述 本文主要针对项目中自动打包过程进行调研,实现用python脚本来打出win/android/ios三个平台下的 ...

  8. iOS应用构建与部署小结

    注:本文首发于我的个人博客:https://evilpan.com/2019/04/06/ios-basics/ 上篇文章介绍了Objective-C的基本概念,本文就来接着看如何创建我们的第一个简单 ...

  9. 使用gitlab ci构建IOS包并发送通知消息到企业微信

    在之前的文章中,我们介绍了使用gitlab ci构建Android包的方法.今天我们介绍使用gitlab ci如何构建IOS包,并且在打包成功或者失败时,如何将消息通知到企业微信. 如果对gitlab ...

随机推荐

  1. JSP/Servlet Web 学习笔记 DayThree

    JSP内置对象 使用JSP语法可以存取这些内置对象来执行JSP网页的Servlet环境相互作用.内置对象其实是由特定的Java类所产生的.每一种内置对象都映射到一个特定的Java类或者端口,在服务器运 ...

  2. hdu 2492 树状数组 Ping pong

    欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励) Ping pong Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 3 ...

  3. 轻松精通awk数组企业问题案例

    考试题1:处理以下文件内容,将域名取出并根据域名进行计数排序处理:(百度和sohu面试题) oldboy.log http://www.etiantian.org/index.html http:// ...

  4. windows系统设备管理器显示全部硬件

    下面的小命令能让隐藏的未卸载掉的硬件设备彻底现身:开始-运行-CMD C:\> C:\>start devmgmt.msc 之后再在Windows 的设备管理器中,单击菜单“显示”-“显示 ...

  5. 【bzoj2306】[Ctsc2011]幸福路径 倍增Floyd

    题目描述 一张n个点的有向图,每个点有一个权值.一开始从点$v_0$出发沿图中的边任意移动,移动到路径上的第$i$个点 输入 每一行中两个数之间用一个空格隔开. 输入文件第一行包含两个正整数 n,  ...

  6. [poj] 2549 Sumsets || 双向bfs

    原题 在集合里找到a+b+c=d的最大的d. 显然枚举a,b,c不行,所以将式子移项为a+b=d-c,然后双向bfs,meet int the middle. #include<cstdio&g ...

  7. 「JOISC 2015 Day 1」卡片占卜

    题目描述 K 理事长是占卜好手,他精通各种形式的占卜.今天,他要用正面写着 I ,背面写着 O 的卡片占卜一下日本 IOI 国家队的选手选择情况. 占卜的方法如下: 首先,选取五个正整数 A,B,C, ...

  8. C中堆和栈的区别

    C++中堆和栈的完全解析 内存分配方面: 堆: 操作系统有一个记录空闲内存地址的链表,当系统收到程序的申请时,会遍历该链表,寻找第一个空间大于所申请空间的堆结点,然后将该结点从空闲结点链表中删 除,并 ...

  9. 转:Java SoftReference 使用构建对象缓存

    本文介绍对象的强.软.弱和虚引用的概念.应用及其在UML中的表示. 1.对象的强.软.弱和虚引用   在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说, ...

  10. Android 的保活的两种解决方案

    原文链接:http://blog.csdn.net/pan861190079/article/details/72773549 详细的阐述了 Android 的保活的两种解决方案 —— 由panhao ...