Specify a specific Provisioning Profile

ios
#1

When building an iOS app, in the ‘Certificate and Provisioning Profile Installer step’ you can specify the ‘Provisioning profile URL’. If I upload several Provisioning Profiles via the ‘Code Signing’ tab (eg. dev, test and stage) how do I tell Bitrise to use the ‘test’ Provisioning Profile for a specific workflow. $BITRISE_PROVISION_URL contains all provisioning profiles (I cannot specify a specific profile).

1 Like

#2

Hi @stefanz,

Thanks for asking this here! :wink:

You can specify that in your Xcode project and in the Xcode Archive step (Select method for export input).

If you use the Xcode 8 auto code signing option, which is now the default for new projects, then the base signing (to create the (xcarchive) is always performed with a special team development profile. To get that we’d suggest you to use codesigndoc as described here: http://devcenter.bitrise.io/ios/code-signing/#collect-the-required-files-with-codesigndoc

To specify the type of export code signing you want to use for generating the IPA (from the xcarchive) you should use the Xcode Archive step’s Select method for export input/option. Related guide: http://devcenter.bitrise.io/ios/code-signing/#configure-xcode-archive-to-create-the-signed-ipa

You can find more info in our iOS code signing guide at http://devcenter.bitrise.io/ios/code-signing/

If you’d have any questions just let us know!

0 Likes

#3

How would you accomplish this same thing using Xamarin Archive? I am trying to achieve the same thing as @stefanz, but I am using Xamarin to build iOS and Android apps simultaneously. I don’t believe the Xamarin Archive step has a similar ‘Select method for export’ option.

In the ‘Certificate and profile installer’ step, I do see a field to specify the Provisioning Profile URL’. However, I am unable to figure out how I can get the URL download location for each of the 3 provisioning profiles I have uploaded to the ‘Code Signing’ tab.

I tried looking in the Build Logs for the download location, but the URL is starred out:

=> Downloading provisioning profile: 1/2
   Downloading (https://con***85c) to (/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise-cert-tmp283166656/profile-0.mobileprovision)
0 Likes

#4

Hi @clee46,

the easiest way is to define different solution configuration|platform configs (also wire in mapping to project configuration|platform), for different code sign types.
For the mapped project configuration|platform define direct code signing properties (Signing Identity and Provisioning Profile).
On bitrise use the desired solution configuration|platform for your workflows.

The other way is to upload certificates and profiles as GENERIC FILE (last section on code sign tab in workflow editor). When you upload a generic file, you have to specify an environment variable, which will hold the download url of the file.
In your workflows, specify these env vars for certificate-and-profile-installer step related input values.

1 Like

#5

Hi @godreikrisztian, thanks for your reply!

I understand your suggestion to use Generic File Storage, since it is very easy to retrieve the URL for the file location. However, I don’t quite follow what you meant by:

What is meant by ‘configuration/platform configs’? The main issue I am having now is, how can I retrieve the URL download location for either a provisioning profile or certificate that I have uploaded to the ‘Code Signing’ tab? Once I can do that, I should have no problem specifying the URL to the ‘Certificate and profile installer’ step.

0 Likes

#6

Hi @clee46,

regarding to: On bitrise use the desired solution configuration|platform for your workflows.

This is part of the first solution, where you specify different configurations (in your solution) for different release types.
For example for app store builds you may define:

  • solution configuration: ReleaseAppStore
  • map this solution configuration to project configurations (you may define ReleaseAppStore configuration for the ios project as well, this way the solution configuration - project configuration mapping is: ReleaseAppStore - ReleaseAppStore)
  • for project configuration (ReleaseAppStore) specify direct code sign properties
  • on bitrise.io lets say you have a workflow which deploys to app store, this workflow should contain xamarin-archive step, set ReleaseAppStore for xamarin_configuration of the step
workflows:
  wf1:
    steps:
    ...
    - xamarin-archive:
        inputs:
        - xamarin_configuration: ReleaseAppStore # for app store builds
        - xamarin_platform: iPhone
    ...
  wf2:
    steps:
    ...
    - certificate-and-profile-installer:
        inputs:
        - xamarin_configuration: ReleaseDevelopment # for development builds
        - xamarin_platform: iPhone
    ...

The certificate download urls are stored (in pipe (|) separated list): BITRISE_CERTIFICATE_URL
The certificate passpharses are stored (in pipe (|) separated list): BITRISE_CERTIFICATE_PASSPHRASE
The provisioning profile download urls are stored (in pipe (|) separated list): BITRISE_PROVISION_URL

If you upload multiple certificates, you can not refer directly to a single certificate.

But if you upload your code sign files as GENERIC FILE, you have to assign an env var per file, which will hold the download location of the file.
Then use this env vars for Certificate and profile installer step inputs, like:

workflows:
  wf1:
    steps:
    ...
    - certificate-and-profile-installer:
        inputs:
        - certificate_url: $MY_CERT_AS_GENERIC_FILE_1
        - certificate_passphrase: $MY_CERT_PASSPHRASE_1 # define as secret/app/workflow env
        - provisioning_profile_url: $MY_PROFILE_AS_GENERIC_FILE_1
    ...
  wf2:
    steps:
    ...
    - certificate-and-profile-installer:
        inputs:
        - certificate_url: $MY_CERT_AS_GENERIC_FILE_2
        - certificate_passphrase: $MY_CERT_PASSPHRASE_2 # define as secret/app/workflow env
        - provisioning_profile_url: $MY_PROFILE_AS_GENERIC_FILE_2
    ...
1 Like