Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mobileprovision-base64 with multiple profiles doesn't work? #113

Open
kellybyrd opened this issue Aug 4, 2023 · 2 comments
Open

mobileprovision-base64 with multiple profiles doesn't work? #113

kellybyrd opened this issue Aug 4, 2023 · 2 comments

Comments

@kellybyrd
Copy link

I have an iOS app with several embedded extensions.
In GitHub secrets, I have
MY_PROVISION_PROFILE_1_BASE64, MY_PROVISION_PROFILE_2_BASE64, MY_PROVISION_PROFILE_3_BASE64, MY_PROVISION_PROFILE_4_BASE64

When I use
mobileprovision-base64: ${{ secrets.MY_PROVISION_PROFILE_1_BASE64 }}
The section of the Action is fine:

[01:17:19]: ------------------------------------------
[01:17:19]: --- Step: install_provisioning_profile ---
[01:17:19]: ------------------------------------------
[01:17:19]: Installing provisioning profile...

But of course the build fails later because I don't have provisioning profiles for all the bundle ids. The above is true if I use any profile 1-4, as long as a I use only one at a time.

When I try more than one

mobileprovision-base64: |
            ${{ secrets.MY_PROVISION_PROFILE_1_BASE64 }}
            ${{ secrets.MY_PROVISION_PROFILE_3_BASE64 }}

the Action fails early with this:

[01:22:46]: ------------------------------------------
[01:22:46]: --- Step: install_provisioning_profile ---
[01:22:46]: ------------------------------------------
[01:22:46]: Installing provisioning profile...
[01:22:46]: ------------------------------------------
[01:22:46]: --- Step: install_provisioning_profile ---
[01:22:46]: ------------------------------------------
[01:22:46]: Installing provisioning profile...
[01:22:46]: Failure to decode /Users/runner/work/IOS/IOS/ios-build-2.mobileprovision. Exit: 1: security: failed to decode message: UNKNOWN (-8183(d)
security: problem decoding

+---------------------------+-----------------------------------------------------+
|                                  Lane Context                                   |
+---------------------------+-----------------------------------------------------+
| DEFAULT_PLATFORM          | ios                                                 |
| PLATFORM_NAME             | ios                                                 |
| LANE_NAME                 | ios export_ipa                                      |
| KEYCHAIN_PATH             | ~/Library/Keychains/ios-build.keychain              |
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/runner/Library/Keychains/login.keychain-db" |
+---------------------------+-----------------------------------------------------+
[01:22:46]: Error parsing provisioning profile at path '/Users/runner/work/IOS/IOS/ios-build-2.mobileprovision'

I have tried each of the individual profiles (they all pass this install_provisioning_profile step). I have tried many combinations of the various profiles together and I have not gotten any of them to work.

Do I understand this wrong? What can I do?

@kellybyrd
Copy link
Author

Update: I ended up using MobileDevOps/[email protected] to turn the base64 .mobileprovision secrets into files, then I was able to use

mobileprovision-path : |
            ./tmp/App.mobileprovision
            ./tmp/Ext1.mobileprovision
            ./tmp/Ext2.mobileprovision
            ./tmp/Ext3.mobileprovision

and it appears to be working.

So, either I don't understand how the mobileprovision-base64 option is supposed to work with multiple secrets, or it doesn't actually work correctly.

@blueish9
Copy link

hi @kellybyrd, I had the same problem with mobileprovision-base64. Here's what I did to resolve it:

  • make sure all extensions are in the same App Group
  • each extension must have a provisioning profile
  • configure mobileprovision-base64 and export-options.
export-options: path_to_options_plist
mobileprovision-base64: |
     ${{ secrets.APP_PROVISIONING }}
     ${{ secrets.EXTENSION_PROVISIONING }}
  • you can create an options.plist file like this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>adhoc</string>
    <key>teamID</key>
    <string>YOUR_TEAM_ID</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>APP_ID</key>
        <string>PROVISIONING_PROFILE_NAME</string>
        <key>EXTENSION_ID</key>
        <string>EXTENSION_PROVISIONING_PROFILE_NAME</string>
    </dict>
</dict>
</plist>

You can find the name of the provisioning profile on Apple Developer portal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants