简体   繁体   English

使用没有代码签名的 xcodebuild 构建 iOS 应用程序

[英]Building iOS applications using xcodebuild without codesign

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的命令行上指定它?

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 answer in order to get a detailed description on how to disable code-signing inside Xcode. 请参阅此Stack Overflow应答 ,以获得有关如何禁用Xcode内部代码签名的详细说明。

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"似乎可以解决问题。

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. 然后,您可以通过删除,如应用程序中的各种文件删除代码签名信息_CodeSignature并使用codesign工具,从应用程序二进制信息。 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. 配置文件或签名信息中没有任何敏感信息。

In the Project Navigator, select your project and open the "Build Settings" section of your project (and not any particular target). 在Project Navigator中,选择项目并打开项目的“Build Settings”部分(而不是任何特定目标)。

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”设置为“不代码签名”。

To avoid code signing, use:为避免代码签名,请使用:

xcodebuild <your options> CODE_SIGNING_ALLOWED=NO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 构建IOS应用程序并向卖方收费而不使用IAP - Building IOS applications and charging the seller without using IAP 管理钥匙串以无人值守xcodebuild对macOS / iOS应用进行代码签名 - Manage keychain to codesign macOS / iOS app with xcodebuild unattended 使用 Xcode 构建 iOS 应用程序有效,但使用 xcodebuild 命令构建相同的应用程序失败 - Building iOS app using Xcode works, but building the same app with xcodebuild command fails 偶尔会看到使用xcodebuild构建错误 - Occasionally seeing error building using xcodebuild Xcode 7.2使用xcodebuild构建项目失败 - Building project using xcodebuild fails with Xcode 7.2 使用Flash Builder 4.5构建移动应用程序(IOS和Android) - Building Mobile applications( IOS & Android) using Flash Builder 4.5 使用xcodebuild与iOS项目和iOS模拟器 - Using xcodebuild with an iOS Project and the iOS Simulator 当仅请求 tvOS 时,xcodebuild 构建 iOS 和 tvOS 目标 - xcodebuild building both iOS and tvOS targets when only tvOS is requested xcodebuild将使用Xcode 6和备用软件包ID进行编码,但不能与Xcode 7进行编码 - xcodebuild will codesign with Xcode 6 and alternate bundle ID but not with Xcode 7 xcodebuild卡在代码签名上? 如何禁用提示? - xcodebuild stuck on codesign? how to disable prompt?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM