1. 程式人生 > >iOS APP archive打包和打包成Ipa

iOS APP archive打包和打包成Ipa

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>