简体   繁体   English

xcode 8 xcodebuild从命令行为多个配置文件进行手动代码签名

[英]xcode 8 xcodebuild manual code signing from command line for multiple provision profiles

In Xcode 7 I was building project through command line for multiple provision profiles by using following commands. 在Xcode 7中,我使用以下命令通过命令行为多个配置概要文件构建项目。 I have multiple provision profiles and multiple code signing certificate linked to those profiles so I need to sign the IPA file with appropriate provision profile. 我有多个配置文件配置文件,并且有多个链接到这些配置文件的代码签名证书,因此我需要使用适当的配置文件签名IPA文件。

PROVISION_PROFILE="My Provision profile name"

xcodebuild -workspace ../ProjectName.xcworkspace -scheme "${PRODUCT_NAME}" -sdk iphoneos -configuration "${CONFIGURATION}" archive -archivePath "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.xcarchive"

xcodebuild -exportArchive -archivePath "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.xcarchive" -exportPath "${BINDIR}/${PACKAGE_NAME}-${CURVERSION}.ipa" -exportProvisioningProfile "${PROVISION_PROFILE}"

Now these commands not working for Xcode 8. I uncheck the automatically manage signing after that it gives below error 现在这些命令不适用于Xcode8。我取消选中自动管理签名,因为它给出以下错误

"someProjectName" requires a provisioning profile. “ someProjectName”需要配置文件。 Select a provisioning profile for the "Debug" build configuration in the project editor. 在项目编辑器中为“调试”构建配置选择一个配置文件。 Code signing is required for product type 'Application' in SDK 'iOS 10.1' Anybody please help me in this. SDK“ iOS 10.1”中产品类型“应用程序”需要代码签名。任何人都可以帮助我。

You are only specifying the provisioning profile in your -exportArchive command. 您仅在-exportArchive命令中指定供应配置文件。 In the -workspace command, Xcodebuild is reaching into the -scheme you specify, which looks at the project.pbxproj file and grabs the provisioning profiles you placed from the project editor for the configurations specified by the scheme being built. -workspace命令中,Xcodebuild进入您指定的-scheme ,该方案查看project.pbxproj文件,并获取您从项目编辑器放置的配置文件,以供所构建方案指定的配置。

If you open your project.pbxproj file in a text editor, you'll see that the Debug configuration has no provisioning profile listed, which is why Xcodebuild is throwing this error. 如果在文本编辑器中打开project.pbxproj文件,则会看到Debug配置中没有列出配置文件,这就是Xcodebuild抛出此错误的原因。 To fix this, add your provisioning profiles in the project editor (or in project.pbxproj ) for the configurations being built by your scheme. 要解决此问题,请在项目编辑器(或project.pbxproj )中添加您的配置文件,以供您的方案所构建的配置使用。

Edit: Now that I better understand the requirements, editing my answer with another option. 编辑:现在,我更好地了解了要求,请使用另一个选项编辑答案。 You can also do this to manually specify the provisioning profile in your build step: 您还可以执行此操作以在构建步骤中手动指定配置文件:

xcodebuild -workspace ../ProjectName.xcworkspace -scheme "${PRODUCT_NAME}" -sdk iphoneos -configuration "${CONFIGURATION}" archive -archivePath "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.xcarchive" PROVISIONING_PROFILE="${PROVISION_PROFILE}"

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

相关问题 如何使用xcodebuild命令行对Xcode9进行自动签名? - How to use xcodebuild command line to do automatic signing with Xcode9? 如何从xcode显示xcodebuild命令行? - How to show the xcodebuild command line from xcode? xcodebuild命令行:传递DevelopmentTeam ID以进行代码签名 - xcodebuild command line: passing DevelopmentTeam ID for code signing purpose Xcode 8,xcodebuild,多个分发包ID和配置文件 - Xcode 8, xcodebuild, multiple bundle ID and Provisioning Profiles 从命令行更改项目的代码签名 - Change Code Signing of Project from command line 带电容器的 Ionic 4:xcodebuild 因手动签名过程而失败 - Ionic 4 with capacitor: xcodebuild fails with manual signing process 为iPhone构建iOS应用程序可以从xCode运行,但不能从命令行运行(xcodebuild) - Building iOS app for iPhone works from xCode but not from command line (xcodebuild) 在从命令行进行构建时为 > 产品类型“App Extension”签署二进制文件时,空标识无效 - xcodebuild build - An empty identity is not valid when signing a binary for the > product type 'App Extension' while making a build from Command Line- xcodebuild build Xcode8/SDK iOS 10.2 设备、配置文件和代码签名问题 - Xcode8/SDK iOS 10.2 device, profiles and code signing problems 从命令行xcodebuild:编译文件的标志 - xcodebuild from command line: compile flag for file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM