Online installation and update of IOS clients-for adhoc certificates

Source: Internet
Author: User
Tags hockeyapp

This article gives you a pure backup, so please disregard the ADHOC certificate internal distribution and ignorance of iOS client development.

In the iOS game or app development process, before the official release to the app store, requires internal testing, the installation of the client is a moderate problem. Apple provides adhoc certificate (normal version can be installed 100 devices, Enterprise Edition unlimited), register the device number can be installed through itunes or wireless network app using Adhoc certificate. Specific not much to repeat.

Resources:
http://www.alexcurylo.com/blog/2010/08/27/wireless-ad-hoc-distribution/
http://www.hanchorllc.com/2010/08/24/introducing-ios-beta-builder/

Previously useful a product called Hockeyapp (http://hockeyapp.net/), to help achieve internal distribution and installation, support online installation, detection updates, very convenient, simple analysis of its principle:

1. The server provides the API for the client to obtain the latest version information , refer to the following:

Https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=json&udid= D2134514a9c016fbd016a0815f1b3f41d9f38c82&sdk=hockeysdk&sdk_version=2.5.4b1&uuid= 87dcb0e9981f34f6ad998590087fc554&app_version=4.2.0.12100902&os=ios&os_version=6.0&device= iphone3%2c1&lang=zh-hans&first_start_at=10%2f09%2f2012&usage_time=27300

 

[

{

"Timestamp": 1349965666,

"Shortversion": "4.2.1",

"Mandatory": false,

"AppSize": 115812817,

"title": "Metal Nation",

"Version": "4.2.1.12101102",

"Notes": "Fix Bugs"

},

{

"Timestamp": 1349788437,

"Shortversion": "4.2.0",

"Mandatory": false,

"AppSize": 115866480,

"title": "Metal Nation",

"Version": "4.2.0.12100902",

"Notes": "Fix Bugs"

},

{

"Timestamp": 1349704154,

"Shortversion": "4.2.0",

"Mandatory": false,

"AppSize": 115866530,

"title": "Metal Nation",

"Version": "4.2.0.12100801",

"Notes": "<p> troubleshoot inaccessible issues. </p> "

},

{

"Timestamp": 1348125250,

"Shortversion": "4.1.0",

"Mandatory": true,

"AppSize": 133946599,

"title": "Metal Nation",

"Version": "4.1.0.12092001",

"Notes": "<p> new version update main content: Construction changes to sub-strata </p>"

},

{

"Timestamp": 1345717028,

"Shortversion": "3.9.4",

"Mandatory": false,

"AppSize": 90793414,

"title": "Metal Nation",

"Version": "3.9.4.12082301",

"Notes": "<p>3.9.4 update content details </p>"

},

{

"Timestamp": 1345115309,

"Shortversion": "3.9.3",

"Mandatory": false,

"AppSize": 69261482,

"title": "Metal Nation",

"Version": "3.9.3.12081601",

"Notes": "<p> this update main content </p>"

},

{

"Timestamp": 1344597742,

"Shortversion": "3.9.2",

"Mandatory": false,

"AppSize": 67664284,

"title": "Metal Nation",

"Version": "3.9.2.12081002",

"Notes": "<p>pa3.9.2 update notes </p>"

},

{

"Timestamp": 1344332672,

"Shortversion": "3.9.1",

"Mandatory": false,

"AppSize": 66645470,

"title": "Metal Nation",

"Version": "3.9.1.12080701",

"Notes": "<p> main improved values </p>"

},

{

"Timestamp": 1343992275,

"Shortversion": "3.9.1",

"Mandatory": false,

"AppSize": 66622883,

"title": "Metal Nation",

"Version": "3.9.1.12080302",

"Notes": "<p> this update main content </p>"

},

{

"Timestamp": 1343992251,

"Shortversion": "3.9.1",

"Mandatory": false,

"AppSize": 66622828,

"title": "Metal Nation",

"Version": "3.9.1.12080301",

"Notes": ""

},

{

"Timestamp": 1343813073,

"Shortversion": "3.9.1",

"Mandatory": false,

"AppSize": 66602801,

"title": "Metal Nation",

"Version": "3.9.1.12080101",

"Notes": ""

},

{

"Timestamp": 1343727905,

"Shortversion": "3.9.1",

"Mandatory": false,

"AppSize": 66560890,

"title": "Metal Nation",

"Version": "3.9.1.12073101",

"Notes": ""

}

]

2. The client based on the version list to determine whether the latest version, and is not to force the update, if necessary to update, can be similar to the Hockeyapp embedded a page display version information, click the Update button, access to the service side of the download update package API.

The page update link code is as follows:

<a href= "itms-services://?action=download-manifest&url=https://sdk.hockeyapp.net/api/2/apps/ 565b9262a3913bb1123c71ba6575e07b?format=plist&udid=d2134514a9c016fbd016a0815f1b3f41d9f38c82 ">Tap here to Update</a>

3. The server provides the API to download the update package, the incoming user device number and the requested version number parameter, returns a Manifest.plist file, essentially an XML, containing the update package description information, as follows:

Https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=plist&udid= D2134514a9c016fbd016a0815f1b3f41d9f38c82

<?xml version= "1.0" encoding= "UTF-8"?>

<! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" >

<plist version= "1.0" >

<dict>

<key>items</key>

<array>

<dict>

<key>assets</key>

<array>

<dict>

<key>kind</key>

<string>software-package</string>

<key>url</key>

<string>https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=ipa&amp;udid= D2134514a9c016fbd016a0815f1b3f41d9f38c82</string>

</dict>

<dict>

<key>kind</key>

<string>display-image</string>

<key>needs-shine</key>

<false/>

<key>url</key>

<string>https://sdk.hockeyapp.net/api/2/apps/565b9262a3913bb1123c71ba6575e07b?format=png&amp;udid= D2134514a9c016fbd016a0815f1b3f41d9f38c82</string>

</dict>

</array>

<key>metadata</key>

<dict>

<key>bundle-identifier</key>

<string>com.idfsoft.idfCity</string>

<key>bundle-version</key>

<string>4.2.1.12101102</string>

<key>subtitle</key>

<string>4.2.1 (4.2.1.12101102) </string>

<key>title</key>

<string>metal nation</string>

<key>kind</key>

<string>software</string>

</dict>

</dict>

</array>

</dict>

</plist>

Where software-package corresponds to the URL of the IPA file, where display-image corresponds to the URL of the app icon image URL

5. Background management, you need to add the page to allow users to upload the latest IPA files and input version update information, the IPA file parsing logic is as follows:

    • Unzip the IPA file as a zip file
    • After decompression, read the root directory of the Info.plist file, is an XML format file
    • Read the cfbundleshortversionstring node, or get the version number shorthand
    • Read Cfbundleversion get version number
    • Read Cfbundleidentifier get unique number
    • Read Cfbundledisplayname get Name
    • Save this information in the database and use it to display the data in the API that generates Manifest.plist.

That's basically it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.