Swift | OTA or Over-The-Air distribution of any iOS Application

Shubhransh Gupta
3 min readJun 3, 2023

--

Without relying on the AppStore or TestFlight, Apple permits you to deploy an archive of your application to up to 100 distinct devices for testing reasons only. You only need to set up an Ad Hoc distribution profile that allows your iOS app to operate on a select group of devices.
Create an archive of your app in Xcode to use the ad hoc distribution. It will launch the Organiser with the selected archive. To make things easier, we should let Xcode handle the signature automatically. It is critical that you enter the UDID of the device that will execute your prototype in the Certificates, Identifiers, and Profiles area of your Apple Developer account. Xcode will re-sign the archive with that device list for Ad Hoc distribution so that the system can validate the device and accept it for installation.

Organizer panel of Xcode

Hit the Distribute App button to export the archive. Don’t forget to select the option “Include manifest for over-the-air installation”.

The manifest is basically a .plist file with the necessary information for the app installation. Here is an example:

<?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://whitesmith.co/apps/mealcard-beta.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>url</key>
<string>https://whitesmith.co/apps/mealcard-57x57.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>url</key>
<string>https://whitesmith.co/apps/mealcard-512x512.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>co.whitesmith.mealcard</string>
<key>bundle-version</key>
<string>3.9.0</string>
<key>kind</key>
<string>software</string>
<key>platform-identifier</key>
<string>com.apple.platform.iphoneos</string>
<key>title</key>
<string>Mealcard</string>
</dict>
</dict>
</array>
</dict>
</plist>

The manifest file is the key to OTA distribution. It contains the path of the .ipa file that needs to be installed.

Since Xcode 10, the manifest file can be generated directly in the Organizer during the export process. You need to fill the form with the path of the .ipa file, a display image of 57x57, and a full-size image of 512x512, both images in .png. This .ipa should be hosted and accessible.

You can change the manifest later after the export succeeds by editing the manifest.plist file, so don’t worry if you don’t know where to host the .ipa. Continue the export by hitting next and choosing “Automatically manage signing”. Export!

After the succeeded export, open the folder that has been created. You can see the manifest.plist and the .ipa file. Those are the files you need to upload in your defined host to be available with a public link. You should change the name of the manifest.plist file to match the name of your .ipa file. I usually upload them using an FTP client and I put them together in the same location, something like:

Upload your .ipa file and plist file to a SSL enabled server. 
If you don’t have an SSL enabled server, you can upload the .plist file
to your DropBox account while keeping the .ipa file on your non-SSL enabled
server.

Now, you just need to send a link to the person who needs to check your prototype, something like this: itms-services://?action=download-manifest&url=https://whitesmith.co/apps/mealcard-beta.plist. This link needs to be open in the iPhone/iPad. Safari will interpret the download action and install the app. You can also make a static webpage and put the above itms link on press a\of any button or tap of any text under href= “” .

<p>Open this in your iPhone/iPad!</p>
<a href="itms-services://?action=download-manifest&url=YOUR-UPLOADED-PLIST-FILE.plist">
Click here</a>.

Thanks!

Refer: https://blog.ricardopereira.eu/2020/05/07/EN-distribute-iOS-app-using-public-link/

--

--

Shubhransh Gupta

I write about: 🧩 SwiftUI techniques and best practices 📱 iOS development tips and tricks ⚡️ Optimizing app performance