iOS4 and wireless application deploy

iOS4 and wireless application deploy

December 21, 2010 22:47 25 comments
 
29 Kudos
Don't
move!

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, on Distribuite 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, then http://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.

<!DOCTYPE HTML>
<html>
  <head>
    <title>Install your application</title>
  </head>
  <body>
    <ul>
      <li> <a href="http://www.example.com/download/myapp.mobileprovision">Install Team Provisioning File</a></li>
      <li><a href="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 urlencoded symbols (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).

  • skope

    Is it possible to wireless distribute your In House application (Enterprise Program Only) without Ad-Hoc distribution

  • elbryan

    Am I wrong, then?
    Because I thought that this process is simplifying the Ad-Hoc distribution.

    What do you mean by “without Ad-Hoc distribution”?

  • Alex

    You dont need to install the .mobileprovision thingie for it to work

  • a) Do you need the UDIDs of the devices which will be installing this app in this method?
    b) What is the number of devices to which you can distribute your app using this method? is is the same 100 or is it unlimited.

    Assuming all this is being done through a normal 99$ developer account and not a enterprise account.

  • elbryan

    a) You need your application being archived with a provisioning profile containing the UDIDs of the devices enabled to use the application

    b) The limit is still 100

    And, yes, you only need a normal 99$ developer account

  • liuji

    hello!

  • liuji

    hello! I think when you click the link ( Install Application) It should have the same effect to tap the url in the safari’s address bar directly.but when I do this ,i got an error that my safari can’t recognize the the prefix “itms-services”,can you tell me what’s the matter? thank you !

    • elbryan

      Are you sure you have correctly written the URL? Because it’s a standard prefix and should work flawlessly.

  • liuji

    thank you for so quick answer.I’m sure the url is right.I doubt there is some difference between click a link on a website and tab the url into the safari’s address bar.should I do something on the webserver to support the protocol(itms-services)?

    • elbryan

      There’s nothing in the webserver that needs to be done.
      The thing is that URL is only handled by iDevices (iPhone/iPad/iPod touch) and won’t work with any other type of OS.

      Onto which device are you testing it?

      • liuji

        hello,thanks for your advices,It’t worked!
        I tested the URL on iMac at first,it gave me an error,but when I access the address in safari which on my iPhone,It also can’t find the server.finally,I made a NSURL object in my application and called safari to implemented it ,It worked,I don’t know why,but it is enough for me!
        By the way,I’m from China,I’m pleased that you can understand what i posted here.
        Thank you !

  • This is exp instal app in safari http://ipa.heaveniphone.com

  • Pravin

    I need to know what methods people are using to distribute (internally) demo of ipad application wirelessly without having to manage UDID?

    I do not need a solution like testflight or betabuilder, all these requires me to manage UDID in the apple provisioning profile portal.

    I am asking this question because I am seeing another studio doing a much smarter way right now and I wish to know how they did it – With a link they gave to us, we can install their demo application from a simple html over the air, and a provisioning profile magically appears in my ipad. All this happened without me telling them the UDID of my ipad, and therefore definitely without them to recompile the project.

    How did they do it? Thanks!

    Note:- I have individual ($99) and enterprises ($299) account, please provide some tricks as well.

  • Atif

    I am getting the error “Cannot connect to mydomain.com” when i am clicking on the link in iPhone browser. However i can browse my domain in iPhone browser. any help?

    • elbryan

      Is your domain reachable from outside your network?
      Namely, does it work if you ask your friend to reach that domain?

      • Atif

        Yes, you can try… http://suavesol.net

        • elbryan

          Which link gives you problems? The provisioning or the download the app file?

          Make sure your link is correctly escaped.
          As I wrote in my post, the &url parameter must contained an escaped url.

          For instance, if your file is located at

          http://suavesol.net/link/to/myfile.ipa

          you should put somethink like

          http%3A%2F%2Fsuavesol.net%2Flink%2Fto%2Fmyfile.ipa

          in the &url parameter of the second li

          You can use something like this to get the encoded version: http://www.motobit.com/util/url-encoder.asp

          • Atif

            Yes, i did this… did we have to link to list file or ipa file?

          • elbryan

            The plist sorry. But the ipa file should definitely contain the same URL.. did you read the bottom of the post? There’s an important update I made an year ago :p

          • Atif

            yes the file name is same for both fields :(

          • elbryan

            I’ve no clue, honestly.

            If you want, you can post your code on Pocoo and send it to me privately if you don’t want to post it publicly (you can find my mail on the top-right corner on my personal web-site.)

  • John

    With OTA distribution like this, can a developer (with an Enterprise account), also disable or delete an app once it has been downloaded? This is a feature 3rd party MDM providers offer. If so, how is disabling and deleting handled?

    • elbryan

      I think you can’t remotely delete or disable an application.
      What you can do is to remote the target device from the provisioning profile. This way the application will automatically expire in two cases:

      a) You update the app and the target device updates it as well
      b) The provisioning profile installed on the device expires

      I think this it, but maybe there’s something more I couldn’t find

  • Sorry, maybe something goes wrong with me, I’ve XCode 4.2. And I cannot select Build and Archive but only Archive. When I share the app I cannot select Distribuite for Enterprise..
    So I do not know how to create the plist.
    Someone could help me?
    Thanks Don

    • Found it, there’s a check button just below the finder, where you can specify file name