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

查看:29
本文介绍了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:

在您的每个目标的构建设置中,您应该为配置文件名称设置一个 $VARIABLE.为此,请从配置文件列表的底部选择其他".这样做将打开一个文本字段 - 为每个目标选择不同的 $VARIABLE - 例如,我为容器应用程序目标选​​择了 $APP_PROFILE$EXTENSION_PROFILEcode> 用于我的 Today 扩展目标

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天全站免登陆