A, requirements,
After the IPA installation package is packaged with the enterprise certificate and exported, it can only be installed on the mobile phone through iTunes and other tools because the ipA installation package is not available on AppStore, and the new version of the APP can also be installed with the help of tools when the software is updated. In order to solve this problem, it is necessary to implement one-click automatic installation and update without tools.
Desired effect:
1. The user opens a web page, clicks the install button, and the phone starts to install the APP.
2. Check the new version when the application starts, click the update button to install the new version of the APP.
Second, implementation scheme
1. Xcode packaging
Xcode checks Include Manifest for over-the-air installation when packaging an export
Next, fill in the relevant URL, where:
App URL is the static resource address of the IPA file
Display Image Static resource address of the icon whose URL is 57×57
Full Size Image Static resource address of a full-size 512×512 icon
Next, export the IPA according to the normal process, which will export a manifest.plist file together
2,How to deploy
Deploy the exported IPA file and the corresponding image of the two ICONS to the server so that it can be accessed through the URL address just filled in. Deploy the manifest.plist file to the server so that it can be accessed through the URL.
⚠️ Note: All urls mentioned above must support HTTPS
Write a web page that contains an install button, which is an A tag, linked to the following address
itms-services://? action=download-manifest&url=https://url.to/your/manifest.plist
Substitution of https://url.to/your/manifest.plist * * * * to step on the actual access to export manifest file URL.
Sample web page:
<! DOCTYPEhtml>
<html lang="zh_CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="Width = device - width, initial - scale = 1.0">
<title>Download</title>
</head>
<body>
<h1>Click the Install button to install the APP</h1>
<a href="itms-services://? action=download-manifest&url=https://url.to/your/manifest.plist">The installation</a>
</body>
</html>
Copy the code
All you need to do is open safari, visit this page, and click the Install button to download and install the APP.
Itms-services ://? Action = download – manifest&url = https://url.to/your/manifest.plist as content production qr code, then use the iOS system at the camera or the scan code editor scan qr code can also download and install the APP.
3. How to update the APP within the APP
In the APP, you just need to start updating the APP by using the following code:
NSURL * URL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=https://url.to/your/manifest.plist"]]; If (url) {/ / if creation is successful, open the url to start the update [UIApplication. SharedApplication openURL: url options: @ {} completionHandler: nil]; }Copy the code
Then the APP will exit and the system will start downloading a new APP.