ipa制作过程打包

时间:2022-03-28 04:00:03
 

Distribute Ad Hoc Applications Over the Air (OTA)

Posted on February 21, 2011 by John Muchow in Xcode



<!--<div style="float: right; >

-->

If you’ve been through the distribution process of an Ad Hoc application, you can appreciate the challenges of getting a build installed on someone’s device. From the differences of working with users on Windows versus Mac machines, to explaining how to import an Ad Hoc provisioning file and the associated build into iTunes, this process is anything but a walk in the park.

In this post I’ll take you through the steps of deploying Ad Hoc builds over-the-air, where users simply point the Safari web-browser (on their iPhone) to a link and tap to install the provisioning file and associated application.

Provisioning Profile

To begin, create a provisioning profile like you would for any other Ad Hoc build. In the image below you’ll notice I created a profile namedAdHocOTAProfile and associated this with the app idAdHocOTA.

ipa制作过程打包

Once the profile is created, download onto your location machine and drag/drop the file onto the Xcode icon, this will install the provisioning file into the following folder:~/Library/MobileDevice/Provisioning Profiles. The image below is a screenshot of the profile path on my machine – notice the provisioning file name is no longer the nice readable name that was written to your file system when you downloaded the file, this is to be expected.

ipa制作过程打包

From within Xcode, you can now associate this provisioning profile with your build. In theTarget settings, select theBuild tab, in the Code Signing section choose the newProvisioning Profile you created:

ipa制作过程打包

Xcode Build and Archive

Once you have a working project within Xcode (with the Code Signing identity set as mentioned above), make sure that you set the build type toDevice.

ipa制作过程打包

From the Build menu in Xcode, choose Build and Archive (if this option is not highlighted, make sure you’ve selectedDevice in the build settings.

ipa制作过程打包

Once the build is complete, the Organizer window will appear – make sure theArchived Applications section is selected on the left panel.

ipa制作过程打包

In the figure above, I’ve updated the Name of the app to AdHoc OTA Test, this is optional, as well as any comments you would like to include.

Click on the Share button, and a new dialog will appear similar to that shown below:

ipa制作过程打包

From the Identity dropdown, select the Provisioning Profile created earlier:

ipa制作过程打包

Now choose Distribute for Enterprise – fill in the URL to the location where you plan to host the application.Note that you must include the fullpath to the application, including the name of the .ipa file that you plan to use:

ipa制作过程打包

At this point, don’t worry about the image files, I believe those are applicable only if you are doing an OTA deployment through an Enterprise developer account (internal app distribution for corporations).Update: Seems there may be a little more to how the images are used beyond Enterprise deployments, see the comments section for more information.

Once you select Ok, you will be prompted for a filename to save the build, verify that you use the same name as you specified in the URL:

ipa制作过程打包

At this point ipa and plist files will be created for you, the provisioning file will be embedded within the ipa.

OTA HTML File

With the build complete, we know need to create a very simple webpage that will allow users to find the application on a web-server.

The html below is as about as bare-bones as we can get, it’s nothing more than a link to the file, with a specific href foritms-services which Safari will recognize and initiate the download/install process when clicked.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<title>OTA Test App</title>
</head>
<body>
<ul>
<li><a href="itms-services://?action=download-manifest&url=http://3SixtySoftware.com/OTAtest/AdHocOTATest.plist"> Tap Here to Install the Application</a>
</li>
</ul>
</body> </html>

Important: – Replace the path shown above with the path to where you will upload the ipa and plist files that Xcode created.

Save the html file with the extension .html

Upload To Web-Server

We’re getting close – at this point we are ready to upload the ipa, plist and html files. The figure below shows the directory listing on the web-server where I uploaded the files:

ipa制作过程打包

Install the iPhone Application OTA

To download the application via OTA, start your web-browser and point it to the link where the html file lives. Once loaded you should see a screen similar to the figure below:

ipa制作过程打包

Tap on the link and a dialog will appear asking if you would like to install the Ad Hoc application:

ipa制作过程打包

If all works as expected, at this point you can send a link to the html file to anyone you included in the provisioning file and they can install the application OTA.

ipa安装过程:

1,工程编译选择Device,然后build and archive选项

2,而后会出现orgnizer界面,然后确认theArchived Applications 左边的选项是选中的,然后有对应的选项,比如PCCW Wi-Fi

3,   选择share按钮,然后在identity中选择对应的证书选项

4,选择Distribute for Enterprise...选项

5,URL -> 填写的是后面需要在设备上输入的web server地址,可以进一步进行安装

6,   Title 可以自定义

7,选择ok

8,弹出的框体save as的名称必须和URL中名称完全相同,比如TestIpa.ipa

9,   然后会生成一个ipa和iplist文件

10,然后需要手动生成一个html,一般叫做index.html,可以先创建一个文本文件,然后把上面的一段内容粘贴进去,注意必须修改url的路径为你填写的url路径,即如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<title>OTA Test App</title>
</head>
<body>
<ul>
<li><a href="itms-services://?action=download-manifest&url=http://3SixtySoftware.com/OTAtest/AdHocOTATest.plist"> Tap Here to Install the Application</a>
</li>
</ul>
</body> </html>

action=download-manifest&url=http://3SixtySoftware.com/OTAtest/AdHocOTATest.plist 这句必须修改为你自己定义的URL地址

11,然后把这三个文件都拷贝到你指定的web server url下,然后在你的设备浏览器中访问这个url,就会出现上面的tap here to install application的选项,然后点击就可以下载

安装到你的设备中去了