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
Most of these answers seem complicated and out dated. I think the simple answer is to make an archive with a Developer profile.
This is a solution which I am currently investigating for my own purposes (not fully tested):
You just need developer access (not team agent) to their account and create a Development provisioning profile that authorizes you to build the specified App ID (you need to specify the App ID, because it gets compiled in). Then Archive the app with the Development profile, and share the archive with your client. They can then re-sign the archive with their own Distribution profile.
One complication is that when you build an archive with a developer profile, the entitlement attribute get-task-allow gets set to true, but needs to be set to false for distribution, so you have to work around that by setting it manually your Entitlements.plist - see my question here: Can I archive with a Developer certificate, then re-sign it during submission with a Distribution certificate?
Best alternative way would be to ask the client to export his distribution certificate private key into .p12 file and send it across to you alongwith the distribution profile with which you can generate a App Store distribution build for your client.
Best of luck!!
Regards, Sam
Ok, found a way to do it without sharing provisioning profiles or certificates.
The idea is to insert a "run script" build phase to trick XCode into signing an App it didn't compile, so you can send a compiled (unsigned) App to the client, and then their XCode signs that App with their cert and profile.
How to do it:
Step 1: Make XCode generate an unsigned Release .app (I'll call this "App A"). See "To Disable Code Signing" here: https://stackoverflow.com/a/10171462/375486
Step 2: Create a new XCode iOS project and remove from it all build phases you can, so it creates an empty .app file (I'll call this "App B")
Step 3: Add a "run script" build phase to Project B which copies the contents of "App A" into "App B". In my case I used this:
cp -r A.app/* "$CODESIGNING_FOLDER_PATH"
Step 4: Send the "B" XCode project to the client, with all the necessary files.
Step 5: The client builds the B project. Under the hood, XCode will run the "run script" command, then sign the resulting app, and the client gets a perfectly signed App.
And that's it :)
Huh, all these look way more complicated then they have to. I use this this:
xcodebuild -scheme "$SCHEME" clean archive \
-archivePath "build/$SCHEME" \
-workspace $PRODUCT_NAME.xcworkspace \
-allowProvisioningUpdates \
-configuration Release \
PRODUCT_NAME="$SCHEME" \
PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
EXECUTABLE_NAME="$SCHEME" \
DISPLAY_NAME="$DISPLAY_NAME" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_ENTITLEMENTS="" \
CODE_SIGNING_ALLOWED=YES