Search code examples
iosipa

Download and install an ipa from self hosted url on iOS


I need to download and install an ipa directly from an URL.

I have tried this:

NSURL *url = [NSURL URLWithString:@"https://myWeb.com/test.ipa"];
[[UIApplication sharedApplication] openURL:url];

The app launches Safari but then this message appears:

Error Message "Download Failed, Safari cannot download this file."

Is it possible?


Solution

  • To distribute your app over-the-air (OTA, this means without using TestFlight or the official App Store), you may need to create 3 different files, namely:

    • The .ipa file (using an ad-hoc provisioning profile)
    • index.html
    • manifest.plist

    See https://support.apple.com/en-gb/guide/deployment/depce7cefc4d/web for more information.

    You can look for a service to generate them for you or you can do it manually:

    index.html

    <a href="itms-services://?action=download-manifest&url=https://myWeb.com/MY_TEST_APP/manifest.plist">Install App</a>

    manifest.plist

    <?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>http://YOUR_SERVER_URL/YOUR-IPA-FILE.ipa</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.yourCompany.productName</string>
                    <key>bundle-version</key>
                    <string>1.0.0</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>title</key>
                    <string>YOUR APP NAME</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    

    If the app refuses to install or run, you may need to check the following items:

    • The provisioning profile you've used when compiling/archiving your app
    • The URLs in both index.html and manifest.plist
    • The plist file may possibly need to be hosted on an HTTPS server. You can use Dropbox for this if necessary.
    • Your device UUIDs may need to be registered inside Apple Developer Center unless you have an Enterprise licence
    • You may need to manually enable access to the app within Settings > Profiles