-1

I have received an IPA file of an iOS app from another team, I need to code sign the IPA file in order to run the app on my device.

I unzipped the IPA file, and it only contains .app file. How could I code sign the IPA file then ? Could some one provide me an step by step tutorial please?

(I have my development certificate, provisioning profile, registered device ready.)

===== UPDATE =====

What I am asking is almost the same as this one, the difference is that when I unzip the IPA, it is an app file which is different than the linked question.

Community
  • 1
  • 1
user842225
  • 5,445
  • 15
  • 69
  • 119
  • Why would you want to do that?, the IPA is already signed, it does not need to be signed again – Benjamin Jimenez Jul 28 '15 at 13:34
  • why downvoting? please check my update, there is a similar question (which is upvoted!!), though the answer is not useful to my question. I need to sign it with my own certificate so that it can be running on my own device. – user842225 Jul 28 '15 at 13:43

1 Answers1

0

You should create a ResourceRules.plist and Entitlements.plist with your credentials. After you create and update those files, delete _CodeSignature folder inside the .app file. Then you can run the following process from the command line:

codesign -f -s 'iPhone Distribution: YOUR_DISTRIBUTION_PROFILE_NAME_HERE' --resource-rules ResourceRules.plist --entitlements Entitlements.plist PATH_TO_APP_FILE

Entitlements.plist 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>application-identifier</key>
    <string>XXXXXXXXXX.com.xxx.app</string>
</dict>
</plist>

ResourceRules.plist 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>rules</key>
    <dict>
        <key>.*</key>
        <true/>
        <key>Info.plist</key>
        <dict>
            <key>omit</key>
            <true/>
            <key>weight</key>
            <real>10</real>
        </dict>
        <key>ResourceRules.plist</key>
        <dict>
            <key>omit</key>
            <true/>
            <key>weight</key>
            <real>100</real>
        </dict>
    </dict>
</dict>
</plist>
furkan3ayraktar
  • 543
  • 10
  • 18
  • thanks for your answer, how to create the two .plist files? I am new in iOS. – user842225 Jul 28 '15 at 13:48
  • Do you mean I should further unzip the .app file? – user842225 Jul 28 '15 at 13:49
  • .app file is actually a folder, just right click and show package contents. I will update my answer with Entitlements and ResourceRules files also. – furkan3ayraktar Jul 28 '15 at 14:18
  • Thanks, and also when I run codesign command, I always get `YOUR_DISTRIBUTION_PROFILE_NAME_HERE no identity found` and an warning `Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!` – user842225 Jul 28 '15 at 14:21
  • You should replace YOUR_DISTRIBUTION_PROFILE_NAME_HERE text with your own certificate. codesign looks for it from the keychain. You should add your certificates to keychain by just double clicking them and you can look for the name from the keychain afterwards. – furkan3ayraktar Jul 28 '15 at 14:24