Building iOS applications using xcodebuild without codesign

IosXcodeBuildCodesign

Ios Problem Overview


We're building an app for another company. They hold the signing key and would rather not share it with us.

It should be possible to separate build and sign, but how do I specify it on xcodebuild's command line?

Ios Solutions


Solution 1 - Ios

In order to skip the code signing you can perform a manual build from the console like this:

xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

Additionally, use the -configuration, -target and -sdk parameters in order to define your build settings.

Refer to this Stack Overflow answer in order to get a detailed description on how to disable code-signing inside Xcode.

Solution 2 - Ios

To completely prevent code signing with Xcode 7, I used all of the following options:

CODE_SIGN_IDENTITY=""
CODE_SIGNING_REQUIRED="NO"
CODE_SIGN_ENTITLEMENTS=""
CODE_SIGNING_ALLOWED="NO"

The final option, CODE_SIGNING_ALLOWED="NO" seemed to do the trick.

Solution 3 - Ios

Unfortunately it can be hard to build your app in release mode without code signing. You will get errors from the build system such as this:

CodeSign error: code signing is required for product type 'Application' in SDK
                'iOS 5.1'

In this case, you should configure your target to use your developer/team wildcard (*) signing identity in Release mode. The app will be signed with that when you build it, and you can ship it to your customer so they can resign it. This is what most of our outsourced developers do.

You may then be able to remove the code signing information by deleting the various files in the app like _CodeSignature and using the codesign tool to remove information from the application binary. But I'm not sure how easy that is. It's not really essential though. There isn't any sensitive information in the provisioning profile or signing information.

Solution 4 - Ios

In the Project Navigator, select your project and open the "Build Settings" section of your project (and not any particular target).

Under "Code Signing", find "Code Signing Identity" and for both Debug and Release modes set "Any iOS SDK" to "Don't Code Sign".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionnoamtmView Question on Stackoverflow
Solution 1 - IosJoernView Answer on Stackoverflow
Solution 2 - IosBen FlynnView Answer on Stackoverflow
Solution 3 - IosMike WellerView Answer on Stackoverflow
Solution 4 - Iosuser3672430View Answer on Stackoverflow