Failed to verify code signature of MYAPP.app

10,946

A distribution provisioning profile cannot be used to install an app on a device directly. The distribution profile and certificate are used to sign the app for distribution through the App Store or Test Flight.

If you want to install the app directly on a device, you will need to use either an iOS Developer Profile and certificate, or if you have an Enterprise account, an In House profile with a developer certificate. Get a developer profile and certificate and build with those. Note that if you are using a development provisioning profile, you will have to make sure the device ID you are trying to install on is in the profile.

However, it appears you are trying to also distribute this through TestFlight. First, your command to validate the signature will not verify anything with the provisioning profile. It just verifies that the code signing was correct. Your error is related to the provisioning profile. I would take the .app, change the extension to .zip and unzip the package. Inside the unzipped folder, you should find and embedded.mobileprovision file. That is the provisioning profile that got bundled with the app when it was built. I would open up that file in Text Edit and check the values in the file to ensure they are correct (specifically things like the app ID).

Share:
10,946

Related videos on Youtube

ssmsexe
Author by

ssmsexe

Updated on June 04, 2022

Comments

  • ssmsexe
    ssmsexe almost 2 years

    I am trying to sign my iOS distribution package with distribution provisioning profile and certificate. The bundle can be created and signed with no error, however, when I try to install the package through command line I get the following error.

    ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008015: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.FVZk62/extracted/Payload/MYAPP.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)

    I can push the application to TestFlight and the app can be installed successfully, but it crashes immediately on Splash Screen with the same error message in the device log.

    I have cross checked application's entitlements and entitlements in ItunesConnect and they completely match. Furthermore, I have validated the signature of my package based on this guide and looks fine.

    I ran the following command and everything looks healthy.

    codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' Payload/MYAPP.app 
    

    The output:

    Payload/MYAPP.app: valid on disk.
    Payload/MYAPP.app: satisfies its Designated Requirement.
    Payload/MYAPP.app: explicit requirement satisfied.

    Has anyone faced a similar problem or know what can be the possible root cause?

  • ssmsexe
    ssmsexe almost 6 years
    Hi @wottle, I should have mentioned that I've tried to install the app using Development cert and provisioning profile with command line and with production cert and provisioning profile through the TestFlight. And got the error in both cases. In addition, I've done a through investigation on the bundle using codesing and security commands based on the technical note from Apple to troubleshoot similar kind of issues. And as I mentioned above I've cross checked app's and bundle entitlement and they're completely identical.
  • ssmsexe
    ssmsexe almost 6 years
    In the given error it's clear that the issue is with code signature and provisioning profile. Also, In the given link, technical note in my original question, there are steps to troubleshoot these issue. The given command is capable of distinguishing a number of code signature issues, that's checking the bundle entitlement and provisioned entitlement.
  • wottle
    wottle almost 6 years
    Yes, the code signing failure reason is A valid provisioning profile for this executable was not found. This means there is no provisioning profile on the device that matches the app Id of the app, and is linked to the certificate that was used to sign the application binary. The provisioning profile is bundled with the app when you build, so if you have your build settings correct, a valid provisioning profile should be installed when you install the ipa from the command line or from TestFlight. Something is not right with your provisioning profile you are choosing for your build.