xcodebuild针对目标依赖项的不同配置文件 [英] xcodebuild different provisioning profile for target dependency

查看:102
本文介绍了xcodebuild针对目标依赖项的不同配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用xcodebuild构建我的应用程序:

I'm trying to build my app with xcodebuild:

xcodebuild -workspace "RG.xcworkspace" -scheme "Production" -configuration "Release" build CONFIGURATION_BUILD_DIR="${TEMP_DIR}" PROVISIONING_PROFILE="1234-5678-9098-7654-3210"

我的计划有两个目标。一个目标是应用程序,另一个是应用程序扩展(我为Safari构建了一个扩展)。应用扩展程序是目标依赖项。每个目标都需要单独的配置文件。我不知道如何为依赖项指定PROVISIONING_PROFILE。我正如预期的那样收到此错误:

My scheme has two targets. One target is the app, the other is the app extension (I built an extension for Safari). The app extension is a target dependency. Each target requires a separate provisioning profile. I don't know how to specify the PROVISIONING_PROFILE for the dependency. I'm getting this error, as expected:

CodeSign error: code signing is required for product type 'App Extension' in SDK 'iOS 8.1'

StackOverflow和xcodebuild的手册页似乎没有提出任何建议。有没有人知道如何用xcodebuild构建一个依赖于两个配置文件的项目?

StackOverflow and the man page for xcodebuild don't seem to come up with anything. Does anyone know how to build a project with xcodebuild that relies on two provisioning profiles?

推荐答案

我花了很长时间研究这个今天。当答案击中我时,我正在上床睡觉的时候:

I spent far too long working on this today. I was on my way to bed when the answer hit me:

在你的每个目标的 Build Settings 中,你应该设置一个 $ VARIABLE 用于配置文件名称。为此,请从配置文件列表的底部选择其他。这样做会打开一个文本字段 - 为每个目标选择不同的 $ VARIABLE - 例如我选择 $ APP_PROFILE 我的今日扩展目标的容器应用目标和 $ EXTENSION_PROFILE

In each of your targets's Build Settings you should set a $VARIABLE for the profile name. To do this, selected "Other" from the bottom of the list of profiles. Doing this will open a text field - choose a different $VARIABLE for each target - for example I chose $APP_PROFILE for the container app target and $EXTENSION_PROFILE for my Today extension target

这将产生如下内容:

最后,使用 xcodebuild 进行构建时,请像使用 PROVISIONING_PROFILE 一样指定配置文件UUID:

Finally, when building with xcodebuild, specify the profile UUIDs as you did with PROVISIONING_PROFILE:

xcodebuild ... APP_PROFILE="85b6f019-d5e5-43a7-9e8f-e3aaed64a7e4" EXTENSION_PROFILE="e50cf605-ab63-40ad-8329-2758359ea748"

从XCode内部构建似乎不受影响 - 据我所知,XCode正在选择默认配置文件(就像在自动模式下一样)

Building from within XCode seems to be unaffected - as far as I could tell XCode is selecting the default profiles (as if in "Automatic" mode)

理论上这也支持多个扩展。

Theoretically this would support multiple extensions too.

使用XCode 6.3为我工作:)

Works for me with XCode 6.3 :)

这篇关于xcodebuild针对目标依赖项的不同配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆