iOS4 and wireless application deploy

来源:互联网 发布:windows系统排名 编辑:程序博客网 时间:2024/05/16 17:46

Starting from iOS4 it is possible to publish applications on to a generic webserver and allow people to download an application with just a single “tap” without using iTunes or Xcode.

The operation is quite straightforward and also well documented in the related Apple Documentation. This is only possible, of course, if you have a valid developer certificate and a list of UUIDs of the devices enabled to run the application onto. Such list is part of the so called “provisioning profile” that is generated through the Apple Developer Portal. The idea is that this method is useful for enterprise development (aka Ad Hoc) and you don’t want to deal with colleagues asking for a new deploy or for the latest version every time you update your application or fix some bug.

So let’s start setting up our system. Fire up Xcode and select Build -> Build and Archive. The Organiser will pop-up. Select the build you want to publish and click on the Share...button above the list. Select then the identity you want to sign your code with (usually this is the same you use for signing the code for a standard deploy on the device). Click, then, onDistribuite for Enterprise..

At this point a form will appear asking you from which URL the application should be downloaded from. Let’s suppose your website is available at www.example.com and your application (the file .ipa) is hosted at www.example.com/download/myapp.ipa, thenhttp://www.example.com/download/myapp.ipa should go in that field. [See the update below]
Fill the other fields as you wish; you can get more information about that in the Apple Documentation

Once you filled the form and clicked OK select the place where to save the generated files (ipa and plist).
Congrats you are done!

Now the tricky parts comes when you have to deal with the webserver-side code. I have created a small example page below.
Remember that you have to put on your website all the files: myapp.ipa, myapp.plist and myapp.mobileprovision.

?
01
02
03
04
05
06
07
08
09
10
11
12
13
<!DOCTYPE HTML>
<html>
  <head>
    <title>Install your application</title>
  </head>
  <body>
    <ul>
      <li> <ahref="http://www.example.com/download/myapp.mobileprovision">Install Team Provisioning File</a></li>
      <li><ahref="itms-services://?action=download-manifest&url=http%3A%2F%2Fwww.example.com%2Fdownload%2Fmyapp.plist">Install Application</a></li>
    </ul>
    </div>
  </body>
</html>

Please notice that the second href is nothing just a plain old-fashioned URL. Nothing special into that. If you are wondering about those weird %2F and %3A they are normal urlencodedsymbols (for ‘/’ and ‘:’ resp.).
Once you did this you are definitely done.

Maybe if I find some time in the near future I will upload a php page that updates automagically the links to the new application snapshot you publish.

Happy sharin’ :)

[UPDATE 11st January 2011]
Please remember that in the URL textfield you should put exactly the link to the file that is going to be hosted on your website. Is it then necessary that you put the same filename both in that URL field as well as in the filename field where Xcode asks you where to put your archived application (the ipa and plist files).

原创粉丝点击