How do I produce an iOS Release Build that my client can sign on their end?

前端 未结 10 704
你的背包
你的背包 2020-12-12 09:17

My scenario

I wrote an iOS app for a client. The project is almost over and now it\'s time for them to put it in the App Store. I\'ve been sending t

相关标签:
10条回答
  • 2020-12-12 09:50

    I just got off the phone with Apple. They say this is the only way to do it: https://developer.apple.com/library/ios/#qa/qa1763/_index.html

    The client adds you to their team, and gives you specific privileges.

    0 讨论(0)
  • 2020-12-12 09:53

    I've been there. Options 2 or 3 are out of question. Option 4 would be ideal, but as you wrote, Apple will not let the agent delegate her privileges to create distribution profiles.

    So basically, your only option is for you to get the distribution profile defined with their account. In order for you to handle it, you would need to login as their agent, which is not an option.

    So they will have to do it. There is no way around that.

    They will also have to invite you as a member of their product development team on their account. You will need to be an admin. That's mean you will have to send a signing certificate request as outlined by Apple.

    Finally, they will have to download and send you the distribution provisioning profiles they created.

    With all that, you will be able to sign your application with their resources.

    0 讨论(0)
  • 2020-12-12 09:57

    I just confirmed at WWDC 2012 that the following technique works. It best satisfies my constraints of little client involvement, low client expertise, a simple signing process, and source code ownership.

    1. Client invites developer to their team in the Member Center as an Admin
    2. Developer accepts the invite (should be in your email)
    3. Developer opens Xcode's Organizer -> Devices Tab -> Provisioning Profiles and hits Refresh in the lower-right corner. Make sure you choose the right team and you should get a few new items.
    4. In Xcode, leave Code Signing Identity settings to their default values (or reset them to iPhone Developer for Any iOS SDK)
    5. Archive the app
    6. In Organizer, right-click the archive and select Show in Finder
    7. Send the .xcarchive file to your client
    8. Client must have Xcode installed
    9. Client double-clicks the .xcarchive file which should open it in Organizer
    10. Client clicks Distribute and signs the app with their identity
    11. Profit

    This does require the client to use the Member Center on developer.apple.com and to use Xcode a little bit (but just the Organizer!). If your client has technical capability problems at this level then I recommend just taking over and doing it for them (and charging for it!). Ask for their developer login and password and just act on their behalf as if you were an employee.

    Ed note: Trading keys around is a terrible compromise because it's more technical and involved for the client and more hacky and risky for the developer. It should be considered a non-option given these two better options.

    0 讨论(0)
  • 2020-12-12 09:59

    I had the same problem. This was how I finally solved it:

    1. Client created a development certificate.
    2. Client created a development provisioning file using the same App ID as the distribution provisioning file.
    3. Client exported development certificate (.p12).
    4. Client sent me the .p12 file and the development mobile provisioning file.
    5. I imported the clients p12 file into my keychain
    6. I imported the client's provisioning file into Xcode.
    7. Set the code signing Identity for my build configuration to use the client's provisioning file.
    8. I Archived the app.
    9. I Sent the Archive to the client.
    10. The client created their distribution build by signing the app with their distribution provisioning file. (They were distributing the app internally for testing.)

    The client was not so concerned with sharing a development certificate as they would be sharing their distribution certificate.

    I also had to create entitlements.plist with "Can be debugged" (get-task-allow) set to NO, and reference it in the build configuration (under Code Signing, Code Signing Entitlements).

    0 讨论(0)
  • 2020-12-12 10:01

    I believe I have found a way to do exactly what you want, I haven't done extensive testing or tried to upload to the app store but from the testing I have done it seems to be good. The resign and the addition of my provisioning profile is working as I can install it on my devices defined in the AdHoc profile with no manual profile installation needed. Second test was I got an iPad and an iPhone version of an app with the same bundle ID from xCode, at first I could not have both in iTunes but after the resign and bundle ID change I was able to have both installed. I also tried changing the app name and that worked as well, it showed on the device and in iTunes with the new name. Below is my script, it's designed to resign a specific app for me, so the profile and bundleID are hardcoded. I flip between an iPhone and iPad version of the app so I added that as a parameter to the script. But you should be able to take the principles I have here and refine them for yourself.

    The guts of this builds upon articles like Further adventures in resigning for iOS from Dan's Dev Diary and very similar to Erica Sadun's App Signer listed above. The main addition I made was the editing of the Info.plist prior to resigning.

    #!/bin/sh
    
    DestFile="Signed_$1"
    SigningCertName="YOUR DISTROBUTION CERT NAME HERE FROM KEYCHAIN"
    AppInternalName="APP NAME FROM INSIDE PAYLOAD FOLDER.app"
    
    echo
    echo "Going to take the app $1 and resign it as $DestFile"
    echo
    
    if [ "$2" = "iphone" ] ; then
            echo "Using iPhone Profile"
            echo
            BundleID="com.YOURCOMPANY"
            ProvProfile="/Users/YOURNAME/Library/MobileDevice/Provisioning Profiles/PROVISIONINGPROFILE.mobileprovision"
    elif [ "$2" = "ipad" ] ; then
            echo "Using iPad Profile"
            echo
            BundleID="com.YOURCOMPANY.ipad"
            ProvProfile="/Users/YOURNAME/Library/MobileDevice/Provisioning Profiles/PROVISIONINGPROFILE_iPad.mobileprovision"
    else
            echo "You must enter either iphone or ipad as the second parameter to choose the profile to sign with."
            echo
            exit 1
    fi
    
    rm -f Resigned.ipa
    unzip -q $1 -d temparea
    cd temparea/Payload
    echo "*** Original Signing ***"
    echo "************************"
    codesign -d -vv $AppInternalName/
    cp "$ProvProfile" ./$AppInternalName/embedded.mobileprovision
    export EMBEDDED_PROFILE_NAME=embedded.mobileprovision
    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    
    #Update the Info.plist with the new Bundle ID
    sed 's/>ORIGINAL BUNDLEID HERE</>'$BundleID'</' ./$AppInternalName/Info.plist >./$AppInternalName/Info.plist.new
    mv -f ./$AppInternalName/Info.plist.new ./$AppInternalName/Info.plist
    
    # this will do a rename of the app if needed
    # sed 's/>ORIGINAL APP NAME</>NEW APP NAME</' ./$AppInternalName/Info.plist >./$AppInternalName/Info.plist.new
    # mv -f ./$AppInternalName/Info.plist.new ./$AppInternalName/Info.plist
    
    # echo "Hit enter to proceed with signing."
    # read TMP
    codesign -f -vv -s "$SigningCertName" -i $BundleID $AppInternalName
    
    echo
    echo "*** New Signing ***"
    echo "*******************"
    codesign -d -vv $AppInternalName/
    cd ..
    zip -r -q ../Resigned.zip .
    cd ..
    rm -R temparea
    mv Resigned.zip $DestFile
    echo
    echo "New IPA Created, $DestFile"
    
    0 讨论(0)
  • 2020-12-12 10:02

    iResign works quite well.

    It allows you to change the bundle id and add entitlements when signing. Probably would work for your use case.

    That being said, the xcarchive solution is more canonical. Be aware that sharing the xcarchive file gives them the dsym.

    If you have any #ifdef DEBUG statements in your code, make sure they are disabled in the build you give them.

    0 讨论(0)
提交回复
热议问题