xctool扩展了今天的扩展 [英] xctool build with today extension

查看:114
本文介绍了xctool扩展了今天的扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个与今天的扩展程序集成的应用程序,我们使用xctool和Jenkins进行持续的构建和内部分发.

we have an app integrated with today extension, we use xctool and Jenkins to do continuous build and in-house distribution.

在命令行中,使用之前

xctool -workspace our_workspace.xcworkspace -scheme app_schme -xcconfig path_to_xcconfig -configuration Release build archive -archivePath path_to_archive

生成存档,然后导出到.ipa,效果很好.

to generate archive and then export to .ipa, it works fine.

但是,现在扩展到今天,我们必须用另一个方案和xcconfig来构建它,我们将证书和配置文件放在xcconfig中,因为今天的扩展是一个新的目标,应该使用自己的证书和配置文件来构建,我是我想知道如何使用xctool.

But right now with today extension, we have to build it with another scheme and xcconfig, we put certificate and provisioning profile in xcconfig, as today extension is a new target and should built with its own certificate and provisioning profile, I'm wondering how to achieve using xctool.

感谢您的帮助.

推荐答案

我终于设法通过xcodebuild导出了ipa文件.由于xctool是基于xcodebuild构建的,因此此答案可能会有所帮助.

I finally managed to export ipa files via xcodebuild. Since the xctool is built upon xcodebuild, this answer might help.

首先,当您创建扩展程序时,扩展程序的目标将被嵌入到主应用程序的方案中.

First of all, when you create an extension, the extension's target will be embedded into your main app's scheme.

因此,无需使用两种方案.

So, there is no need to use two schemes.

然后,在项目设置页面中,创建一个新配置,例如AdHoc.然后,您可以在目标的两个构建设置中都设置一个新的Provisioning Profile.

Then, in your project settings page, create a new configuration, say AdHoc. And then you can set a new Provisioning Profile in both of your target's build settings.

(项目设置)

(一个目标的构建设置)

(the build settings of one target)

然后为目标设置正确的配置文件(最好将code sign identity设置为自动,以便Xcode可以确定要使用的代码符号身份).

Then set the right provisioning profiles for your targets (And you'd better set the code sign identity to automatic, so that Xcode can determine which code sign identity is to be used).

下一步,您可以使用上面刚刚创建的新配置,使用xcodebuild来存档您的应用程序:

Next step, you can archive your app using xcodebuild with the new configuration you just created above:

xcodebuild -project Extension\ Demo.xcodeproj -scheme Extension\ Demo -sdk iphoneos -archivePath ./Build/extension-demo.xcarchive -configuration AdHoc archive

在此步骤中,代码签名将通过您指定的配置文件分别对两个目标进行签名.

In this step, the codesign will sign two of your targets separately by the provisioning profiles you specified.

最后,再次使用xcodebuild将.xcarchive文件导出到ipa

Finally, export the .xcarchive file to ipa, again using xcodebuild;

xcodebuild -exportArchive -archivePath ./Build/extension-demo.xcarchive -exportPath ./Build/extension-demo.ipa -exportWithOriginalSigningIdentity

请注意,已设置-exportWithOriginalSigningIdentity,以便xcodebuild不会对您的ipa重新签名,并保留xcarchive文件中的代码签名.

Notice that -exportWithOriginalSigningIdentity is set, so that xcodebuild will not re-sign your ipa, and the code signature in the xcarchive file is preserved.

这篇关于xctool扩展了今天的扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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