Xctool build with today's extension

We have an application integrated with today's extension, we use xctool and Jenkins for continuous build and internal distribution.

On the command line before using

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

to generate an archive and then export to .ipa, it works great.

But right now, with today's extension, we need to build it using a different scheme and xcconfig, we will put the certificate and provisioning profile in xcconfig, since today's extension is a new goal and should be built with its own certificate and preparation profile, m wondering how to achieve using xctool .

Any help is appreciated.

+6
source share
1 answer

I was able to export ipa files through xcodebuild. Since xctool is built on xcodebuild, this answer may help.

First of all, when you create an extension, the purpose of the extension will be built into your main application scheme.

enter image description here

Thus, there is no need to use two schemes.

Then, on the project settings page, create a new configuration, say AdHoc . And then you can install the new Provisioning Profile in both settings of your target assembly.

enter image description here

(project settings)

enter image description here

(build settings for one target)

Then set the correct provisioning profiles for your purposes (and you better set code sign identity to automatic so that Xcode can determine which code sign identifier should be used).

In the next step, you can archive your application using xcodebuild with the new configuration that you just created:

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

At this point, the code will sign two of your goals separately for the specified security profiles.

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

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

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

+3
source

Source: https://habr.com/ru/post/979507/


All Articles