Santiago
Santiago

Reputation: 341

Enterprise app deployment doesn't install on iOS 8.1.3

After updating iOS 8.1.3, I tried to download, but getting error "Unable to download app" and "could not be installed at this time" messages appears.

What are changes between 8.1.2 and 8.1.3 which i have to take into consideration?

Download mode:
< a href="itms-services://?action=download-manifest&url=https://****.plist">

Thanks!

Upvotes: 34

Views: 23664

Answers (8)

Hennry
Hennry

Reputation: 1

I have sovled this problem.

  1. Since Apple has changed provisioning profiles, please RENEW the provisioning profiles (File 1) and copy it into the "Payload/".
  2. Make sure there's a Entitlements.plist (File 2) in the "Payload/", and this plist file MUST be PLAIN TEXT which is created by a text editor.
  3. Make sure there's a Info.plist (File 3) in "Payload/", and this is created by XCode;
  4. Copy the Entitlements.plist (File 4) anywhere else except the "Payload/".
  5. Be sure "Bundle identifier" in File 1-4 should be the same.
  6. Use this Entitlements.plist (File 4) to Re-Sign the IPA file.

You can resign it like this

codesign -fs "iPhone Distribution: Your Company Name" --entitlements=/Users/SenTR/Downloads/codesign/Entitlements.plist /Users/SenTR/Downloads/codesign/Payload/Your_Project_name.app

Entitlements.plist sample

<?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>application-identifier</key>
        <string>PREFIX.yourappBundleID</string>
        <key>aps-environment</key>
        <string>production</string>
        <key>get-task-allow</key>
        <false/>
        <key>keychain-access-groups</key>
        <array>
            <string>PREFIX.yourappBundleID</string>
        </array>
    </dict>
</plist>

If you know Chinese, this will be helpful.

http://hennry.com/2015/03/fail-to-resign-ipa-since-ios8/

Upvotes: 0

JohnGom
JohnGom

Reputation: 91

I've done quite a few experiments with this. In my experience the bundle identifier in the manifest.plist file isn't actually that critical. The most important thing to do is to get the entitlements.plist correct.

Rather than creating this manually I would recommend generating it from the provisioning profile using the following script (credit):

# Create an entitlements file
# parse provision profile
security cms -D -i "provProfile.mobileprovision" > ProvisionProfile.plist 2>&1

# generate entitilements.plist
/usr/libexec/PlistBuddy -x -c "Print Entitlements" ProvisionProfile.plist > Entitlements.plist 2>&1

You can then use this entitlements file with the --entitlements option on the codesign utility.

Upvotes: 6

Joel Jeske
Joel Jeske

Reputation: 1647

In addition to @Mark's and @RaStudio's answers, I have seen two more causes for the 'Unable to download application' message; one of which is new to iOS 8.1.3.

New failure cause on iOS 8.1.3

This error occurs when trying to install an application that has an expired provisioning profile. When signing an application, both the certificate and the provisioning profile must be valid and not expired. It seems as though an application with an expired provisioning profile and non-expired certificate can be installed on iOS 8.1.2 in some circumstances. Ensure that the provisining profile is not expired by going to Apple's developer center.

Old failure cause

This error occurs when trying to download an application signed with a development certificate and provisioning profile if the device has not been added to the development provisining profile on Apple's developer center.

Ensure device is added to provisioning profile

Upvotes: 0

iPwnTech
iPwnTech

Reputation: 555

After investigating..

Edit: After further testing, I found that simply matching the bundle ID in the Info.plist and the bundle ID in the manifest.plist worked for installing apps over-the-air on iOS 8.1.3. If this solution does not work, try the solution below.


Original Solution

Fix to the problem:

Your application must have a valid entitlements.plist, which includes correct the valid bundle identifier of an application.

If you are distributing an application signed with a iOS development certificate, here is an example of a entitlements.plist you should include with your app.

<?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>application-identifier</key>
    <string>com.yourbundleidhere.mycoolapp</string>
    <key>com.apple.developer.team-identifier</key>
    <string>com.yourbundleidhere.mycoolapp</string>
    <key>get-task-allow</key>
    <true/>
    <key>keychain-access-groups</key>
    <array>
        <string>com.yourbundleidhere.mycoolapp</string>
    </array>
</dict>
</plist>

If you are using a wildcard profile, replace com.yourbundleidhere.mycoolapp with yourwildcardappid.*. In both instances, you can use iResign to properly resign applications and include the now required, entitlements.plist.

Explanation of the problem

Due to security patches (see here under CVE-2014-4493), without the entitlements.plist, the application will not install. The security patch keeps applications from overriding existing apps and installing over the top of them/replacing them.

Upvotes: 8

Sisira
Sisira

Reputation: 19

I have answered this here, this worked for me without having to do anything else

Upvotes: 0

Mark Chamberlain
Mark Chamberlain

Reputation: 361

After a few hours wracking braincells, here's how I did it:

NOTE: I haven't currently tested this against iOS 8.1.2 or lower (proceed with caution!)

For apps that have ALREADY been signed with your OWN enterprise certificate, all you have to do (as mentioned by RAStudios in his edit) is to edit the manifest.plist:

Before:

<key>bundle-identifier</key>
<string>uk.co.acme.AcmeApp</string>

After:

<key>bundle-identifier</key>
<string>S836XXACME.uk.co.acme.AcmeApp</string>

For apps that have been signed by a third party that you're resigning with your enterprise certificate (this walkthrough is assuming the ipa file is AcmeApp.ipa, your entitlements file is entitlements.plist and your provisioning profile is provProvile.mobileprovision; all files are in the Desktop folder (Mac OSX), and S836XXACME is your team identifier):

Create a new entitlements.plist file:

<?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>application-identifier</key>
<string>S836XXACME.uk.co.acme.AcmeApp</string>
<key>get-task-allow</key>
<false/>
</dict>
</plist>

Unzip the ipa:

cd ~/Desktop

unzip AcmeApp.ipa 

Remove the Code Signature:

rm -r Payload/AcmeApp.app/_CodeSignature/ 

Copy in the mobileprovision file:

cp provProfile.mobileprovision Payload/AcmeApp.app/embedded.mobileprovision 

Codesign:

codesign -f -s "iPhone Distribution: ACME Corporation Limited" --entitlements entitlements.plist Payload/AcmeApp.app

Zip it up as the resigned ipa:

zip -qr AcmeApp_resigned.ipa Payload/

You also need to amend the manifest.plist file as per the 'ALREADY' signed part earlier:

<key>bundle-identifier</key>
<string>S836XXACME.uk.co.acme.AcmeApp</string>

Upvotes: 35

Arun Vishnu
Arun Vishnu

Reputation: 1

I have the same issue and this happens for the applications that doesn't have any entitlements.

Re-signing the app with entitlement solved the issue for me, but this is going to be pain as all the applications that are already deployed need to be re-signed and deployed.

This is a weird issue because these apps which failed for me doesn't use anything like keychain sharing or push notifications and hence doesn't need an entitlement at all (as per my understanding). Now when I just add an entitlement with keychain-sharing it starts working.

Upvotes: 0

user4505430
user4505430

Reputation: 9

ios 8.1.3: inhouse app need distribute with MDM.

MobileInstallation

Impact: A malicious enterprise-signed application may be able to take control of the local container for applications already on a device

Description: A vulnerability existed in the application installation process. This was addressed by preventing enterprise applications from overriding existing applications in specific scenarios.

from apple release note

Upvotes: -1

Related Questions