Provision profile expires with iOS app re-signing

Source: Internet
Author: User

This article main reference: IOS app re-signing method Introduction-Haven ' s Blog

In fact, the IPA file is a zip file, only the suffix is different. To re-sign, we need to prepare the certificate and provision profile, the certificate directly in the Keychian management, provision profile and certificate is the corresponding relationship. Real-machine debugging or submitting apps to the App Store should never be a stranger to friends.

The following steps are directly mentioned:
A. Extract the IPA file
B. Delete the old signature file
C. Copy the new provision profile to replace the old Embedded.mobileprovision
D. Re-signing with the codesign command
F. Re-zip to IPA file

Here is a script that completes the 5 steps above:

#!/bin/shif !  ([ -f  "$"  ]  thenecho \ "${1}\" file does not exist Exitfiipaname=${1%.ipa} if [  "$ipaName"  =  "$"  ]; thenecho \ "${1}\" is not an IPA file exitfi## step 1 , unzip ipa fileunzip ${ipaname}.ipa## step 2, remove old  Codesignrm -rf payload/*.app/_codesignature/## step 3, copy new provision  profilecp 123.mobileprovision Payload/*.app/embedded.mobileprovision## step 4,  Codesign with new certificate and provision (/usr/bin/codesign -f -s  " iphone developer: xxxxx  (XXX) " --resource-rules payload/*.app/resourcerules.plist  payload/*.app/)  | |  {## if code sign error, will to hereecho failedrm -rf  payload/exit}## step 5, zip itzip -r ${ipaname}abc.ipa payload/rm -rf payload/ 

Need to note that there are two in the script you need to manually modify, the first is 123.mobileprovision, this file needs to be placed in the same directory with the script, the second is xxxxx (XXX), here XXX to your Keychian certificate, only need to change xxx, brackets reserved.

My notes:

The parentheses above are not necessarily necessary, depending on the certificate in your Keychian. If the certificate you need in the Keychian certificate list is enclosed in parentheses, it is not required if you do not take it with you.

Also, pay attention to the issue of the name of the certificate, if the same name, you will see the following prompt:

iphone distribution:xxxxxx ambiguous (matches "iphone distribution:xxxxx" and "iphone distribution:xxx" in/users/admin /library/keychains/login.keychain)

Removing the duplicate certificate will solve the problem.


Extended use: Used to determine if the provision profile is invalid/expired

Recently encountered a problem, with the enterprise certificate issued by the app download installation failed, the main performance is the installation progress bar can see is full, but the last step is not, guess is the verification is unsuccessful.

The first is to guess provision profile expired, but in the developer center to see the corresponding bundle ID provision profile, is not expired, which is very strange in itself, anyway, try it first. First in the developer in the heart of the provision profile deleted, and then regenerate one and download. Then use the method above to try the re-signed IPA can be installed. After my test, the re-signed IPA on my iphone is ready to be installed.


another way to analyze This problem :

Connect your iphone to your Mac, open Xcode, select Window--devices on the menu, find your device name, and look at the log at the bottom right to see the following logs:

14:54:30 iphone installd[5481] <notice>: 0x100594000-[miinstaller performinstallationwitherror:]: Installing <miinstallablebundle id=cn.app.test; version=6_1434698124, shortversion=1.4>
14:54:30 iphone misagent[5495] <error>: Attempt to install invalid profile:0xe8008011
14:54:30 iphone installd[5481] <error>: 0x100594000-[miinstallablebundle _installembeddedprofileinbundle :]: Could not install embedded profile:0xe8008011 (Expired)

According to this article, 0xe8008011 represents the Provisioning profile being loaded is expired, can be confirmed that Provisioning profile expired.

The meaning of various error codes that occur when an IPA installation fails:

0xe8008003 -It is unable to get the Creation Date of the Provisioning profile being loaded

0xe8008010 -Provisioning profile Version was not equal to 1 (?)

0xe8008012 -The UUID of the device does not match any in the Provisioning profile being loaded

0xe8008011 -The Provisioning profile being loaded is expired

0xe8008003 -No UUID included in the Provisioning profiles is being loaded







Provision profile expires with iOS app re-signing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.