This post duplicates our knowledge base entry here.
Code-signing of iOS apps is often quite tricky and so questions on it arise.
It is common to have situations where build on different machines needs different code-signing settings Developer may use his own
iPhone Developer identity to test app on his device, however appropriate
iPhone Distribution identity has to be used for “Ad-Hoc” builds sent to testers.
When using continuous integration builds it may rise the problem: if identity set in Xcode project is
iPhone Developer and it is committed into source code repository – it cannot be used by build server as is.
The solution is simple. Xcode has concept of build configurations and by default two of them are available:
So there are two ways to solve the problem:
Releasebuilds. Then use
Releaseconfiguration in CI builds.
Add configuration specific to CI build and make it use appropriate
iPhone Distributionidentity. Then use it in CI builds.
In both cases you’ll be able to commit Xcode project into repository and then not have to override identity for each specific build. However in first case developer still occasionally may need to alter code signing identity to debug