archive打包就是项目做在最后一部,打包上线到APP Store上(非越狱版)。打包成ipa就是为了上线到PP助手、快用助手、360等网站上(越狱版)。
开发环境 : Xcode 6以上 & Object C
一、archive打包
1、模拟器选择iOS Device
2、选择Product——archive,系统会自动编译出结果。
没错archive打包就是这么简单,打包好了就可以上线到app store上。
二、打包成ipa
1、配置Run 的Build Configuration 选择Release。步骤如下:
2、模拟器选择iOS Device,再command + B。
如果你的Products——app有红色变成黑色,说明以上步骤你都是真确的。你可以右击“show in Finder”,查找到你的文件包
3、手机连上电脑打开Itunes—选择我的应用,将你的文件包拖入到你的应用中,系统会自动生成一个应用,右键点击“在Finder中显示”,你就会发现已经生成好了ipa。
三、可能出现的错误
在打包的过程中,你有可能会遇到“Your build settings specify a provisioning profile with the UUID ”,provisioning prifile文件是存储在项目中的**.xcodeproj文件,系统会自动下载,我们修改provisioning prifile,就可以解决问题。
1、找到项目中的**.xcodeproj文件,点击右键,show package contents(打开包内容)。
2、打开后找到project.pbxproj文件,用文本编辑器打开。其实就是右键,点击open就好了。
3、打开这个文件后,按command+F,在这个文件中查找“PROVISIONING_PROFILE",找到和这个
<code><span style="font-size: 14px;">"PROVISIONING_PROFILE" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB"</span></code><pre class="lang-c prettyprint prettyprinted" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 5px; border: 0px; vertical-align: baseline; background-color: rgb(255, 255, 255); overflow: auto; width: auto; max-height: 600px; line-height: 18px;"><span style="background-color: transparent;"><span style="font-size:18px;">类似的都删除。</span></span>
<span style="background-color: transparent;"><span style="font-size:18px;"></span></span><pre class="lang-c prettyprint prettyprinted" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 5px; border: 0px; vertical-align: baseline; background-color: rgb(255, 255, 255); overflow: auto; width: auto; max-height: 600px; line-height: 18px;"><span style="background-color: transparent;">4、然后保存文件,重新打开项目。</span>