Building iOS frameworks using bitrise?

Hello…

I am trying to build an iOS framework using bitrise.
At first I received this error when performing the XCODE archive step…

“Failed to parse archive, error: Info.plist not exists at”,
and when I ran it with a fresh clone on my local machine I noticed that the output directory was empty. Which would explain why Info.plist could not be found.

So I replaced the the ‘Skip Install’ parameter from ‘yes’ to ‘no’ and when I ran it on another fresh installation. The output directory was properly created with the following…

BCSymbolMaps
Info.plist
Products
dSYMs

I committed my change, and now I am received a new error…

“Failed to parse archive, error: failed to find main app”
This makes sense because I am building a framework not an iOS application.

I did more investigation to find this link.
Here I found this snippet that contradicts my previous configuration change.

If you get this error in the Xcode Archive step you should check your Xcode Projects settings. Most likely you have the Skip Install option set to YES.

This should only be used for iOS frameworks, for iOS apps this should be set to NO.

Has anyone successfully built an iOS framework and could provide some context to steer me on the correct route?

…Update

while debugging… I foudn that the .framework is being created during testing.
/Users/vagrant/Library/Developer/Xcode/DerivedData/
/Build/Products/Release-iphonesimulator/*.framework

Hi @quoc_axiadids,

What command / step did you try to build the framework with?

Hello @viktorbenei,

I am using the same default commands in the bitrise run

xcodebuild -project project -scheme scheme archive -archivePath archicePath | xcpretty

@viktorbenei,

I changed the command to this…

xcodebuild \
-project \
-target \
-scheme \
-sdk iphoneos

This builds a successful framework on my local machine in

/Users/*/Library/Developer/Xcode/DerivedData/ … / *.framework

But how would I create this command in the workflow?
I can create a script with the working command, then zip the framework file to $BITRISE_DEPLOY_DIR, but it does not create an installer page.
However; is there a workflow step available that can build the framework, and have it publicly accessible via the installer page?

Indeed that’s our current recommendation. If you have some time feel free to create a Step for that, it’s quite simple to turn a Script into a step! :wink: http://devcenter.bitrise.io/bitrise-cli/create-your-own-step/

Public Install Pages are only available for .ipa and .apk files right now, so it’s not possible to have one for the framework. Of course that page is a public install page and you can’t install a framework, so it kind of make sense I guess :smiley:

You can of course access any of the attached files on the build’s page, in the Apps & Artifacts section/tab:

it’s just the public install page which is not available for other types of files / artifacts.

Thank you @viktorbenei!

Are there plans in the woodwork to be able to retrieve access to these downloadable links?

I wanted to download the artifact from a different bitrise project that depends on the framework.
These different bitrise project would be triggered with a cURL request with the link to the framework as an added environment variable. Then it would be downloaded via wget.

Use can use the API to fetch artifacts: http://devcenter.bitrise.io/api/v0.1/#get-appsapp-slugbuildsbuild-slugartifacts

1 Like

We’re also using Bitrise for iOS framework development and ended with following script (building fat binary btw, with slices for x86 and arm):

We also have some apps used for framework testing and we just added script steps after the build where we push framework to the apps repos. This triggers webhooks for them, also on Bitrise.

Hope this helps.

1 Like

Thanks @igor.asharenkov for sharing! :wink: