ios 使用xcodebuild联编不协同设计构建iOS应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11034133/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Building iOS applications using xcodebuild without codesign
提问by noamtm
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?
应该可以将构建和签名分开,但是如何在 xcodebuild 的命令行上指定它?
回答by Joern
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.
此外,使用-configuration
,-target
和-sdk
参数来定义您的构建设置。
Refer to this Stack Overflow answerin order to get a detailed description on how to disable code-signing inside Xcode.
请参阅此堆栈溢出答案以获得有关如何在 Xcode 中禁用代码签名的详细说明。
回答by Ben Flynn
To completely prevent code signing with Xcode 7, I used all of the following options:
为了完全防止使用 Xcode 7 进行代码签名,我使用了以下所有选项:
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.
最后一个选项,CODE_SIGNING_ALLOWED="NO"
似乎这样的伎俩。
回答by Mike Weller
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.
然后,您可以通过删除应用程序中的各种文件_CodeSignature
以及使用该codesign
工具从应用程序二进制文件中删除信息来删除代码签名信息。但我不确定这有多容易。但这并不是必不可少的。配置文件或签名信息中没有任何敏感信息。
回答by user3672430
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".
在“代码签名”,找到“代码签名身份”和“不要代码签名”定“在任何iOS SDK” Debug和Release模式。