[英]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.